[bugfix]: 修复select、popup组件文档错误,改善部分组件文档一致性 (#333, #334)

#332 #333
This commit is contained in:
rex 2018-07-02 17:24:58 +08:00 committed by GitHub
parent ba9ede4453
commit ec33af57e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 34 additions and 42 deletions

View File

@ -4,7 +4,7 @@
在 json 文件中配置button组件
```json
"usingComponents": {
"zan-button": "/dist/btn/index"
"zan-button": "path/to/zanui-weapp/dist/btn/index"
}
```
@ -53,8 +53,8 @@
1.在 json 文件中配置 button-group 组件
```json
"usingComponents": {
"zan-button": "/dist/btn/index",
"zan-button-group": "/dist/btn-group/index"
"zan-button": "path/to/zanui-weapp/dist/btn/index",
"zan-button-group": "path/to/zanui-weapp/dist/btn-group/index"
}
```
2.在 wxml 中直接引入

View File

@ -5,7 +5,7 @@
```json
{
"usingComponents": {
"zan-capsule": "/packages/capsule/index"
"zan-capsule": "path/to/zanui-weapp/dist/capsule/index"
}
}
```

View File

@ -3,31 +3,27 @@
### 使用指南
#### 单个 cell 使用示例
~~~json
```json
{
...
"usingComponents": {
"zan-cell": "../../dist/cell/index",
"zan-cell": "path/to/zanui-weapp/dist/cell/index",
}
...
}
~~~
```
~~~wxml
```wxml
<zan-cell title="单行列表" label="附加描述" value="详细信息"></zan-cell>
~~~
```
#### cell 组使用示例
多个 cell 组件必须作为 `cell-group` 组件的子组件,否则可能出现显示问题。
```json
{
...
"usingComponents": {
"zan-cell": "../../dist/cell/index",
"zan-cell-group": "../../dist/cell-group/index"
"zan-cell": "path/to/zanui-weapp/dist/cell/index",
"zan-cell-group": "path/to/zanui-weapp/dist/cell-group/index"
}
...
}
```
@ -64,4 +60,4 @@
| ------------- | ----------- | ---- | --------------------------------------------------------------------- |
| 默认 | 否 | 无 | 左侧除了 `title``label` 外的自定义 wxml 内容 |
| icon | 否 | 无 | 标题前自定义的 icon可使用 `icon` 自定义组件,具体使用参考 icon 组件 |
| footer | 否 | 无 | 右侧自定义 wxml 内容,如果设置了 `value` 属性,则不生效 |
| footer | 否 | 无 | 右侧自定义 wxml 内容,如果设置了 `value` 属性,则不生效 |

View File

@ -2,19 +2,22 @@
使用 picker 组件开发的时间日期组件,弥补小程序 picker 自身对于快速时间选择的不支持。
### 示例代码
### 使用指南
在 index.json 中引入组件
```json
{
"usingComponents": {
"zan-date-picker": "../../dist/datetime-picker/index"
"zan-date-picker": "path/to/zanui-weapp/dist/datetime-picker/index"
}
}
```
### 代码演示
可以在任意位置上使用 zan-date-picker 标签。
```wxml
<zan-date-picker
bindchange="change"
bindchange="change"
bindcancel="cancel"
placeholder="请选择一个时间"
placeholder-class="my-customer-class-name"

View File

@ -4,11 +4,9 @@
在 index.json 中引入组件
```json
{
...
"usingComponents": {
"zan-loading": "../../dist/loading/index"
"zan-loading": "path/to/zanui-weapp/dist/loading/index"
}
...
}
```

View File

@ -5,7 +5,7 @@
```json
{
"usingComponents": {
"zan-panel": "/packages/panel/index"
"zan-panel": "path/to/zanui-weapp/dist/panel/index"
}
}
```

View File

@ -53,7 +53,7 @@ togglePopup() {
| 参数 | 说明 | 类型 | 默认值 | 必须 |
|-----------|-----------|-----------|-------------|-------------|
| show | 是否显示弹出层 | Boolean | false | |
| overlay | 是否显示遮罩层 | Boolean | false | |
| overlay | 是否显示遮罩层 | Boolean | true | |
| closeOnClickOverlay | 遮罩层点击时,是否触发关闭事件 | Boolean | true | |
| type | 弹出层动画方式, 可选`center`, `left`, `right`, `top`, `bottom` | String | center | |
@ -62,5 +62,3 @@ togglePopup() {
|-----------|-----------|-----------|
| click-overlay | 遮罩层点击触发 | |
| close | 遮罩层关闭时触发 | |

View File

@ -5,7 +5,7 @@
```json
{
"usingComponents": {
"zan-select": "/packages/select/index"
"zan-select": "path/to/zanui-weapp/dist/select/index"
}
}
```
@ -33,7 +33,7 @@ Page({
name: '选项二',
},
],
checkedValue: '选项一',
checkedValue: '1',
activeColor: '#ff4443'
},

View File

@ -5,13 +5,13 @@
```json
{
"usingComponents": {
"zan-switch": "/packages/switch/index"
"zan-switch": "path/to/zanui-weapp/dist/switch/index"
}
}
```
### 代码演示
=======
可以在页面任意位置上使用 zan-switch 标签。
```html
<zan-switch
disabled="{{ disabled }}"
@ -49,6 +49,3 @@ Page({
| 事件名称 | 说明 | 回调参数 |
|-----------|-----------|-----------|
| change | 当绑定值变化时触发的事件 | event对象和数据对象包含loading和checked |

View File

@ -4,18 +4,10 @@
在 json 文件中配置tag组件
```json
"usingComponents": {
"zan-tag": "/dist/tag/index"
"zan-tag": "path/to/zanui-weapp/dist/tag/index"
}
```
### 属性
| 名称 | 类型 | 是否必须 | 默认 | 描述 |
|---------|---------|----------|------|-------|
| type | String | 否 | 空 | tag类型值有primary、warn、danger |
| plain | Boolean | 否 | false | tag是否镂空默认为false |
| disabled | Boolean | 否 | false | tag是否禁用默认为false |
### 代码演示
#### 基础用法
@ -43,3 +35,11 @@ tag禁用状态
<zan-tag disabled>不可用</zan-tag>
```
### API
| 名称 | 类型 | 是否必须 | 默认 | 描述 |
|---------|---------|----------|------|-------|
| type | String | 否 | 空 | tag类型值有primary、warn、danger |
| plain | Boolean | 否 | false | tag是否镂空默认为false |
| disabled | Boolean | 否 | false | tag是否禁用默认为false |