docs: prettier all markdown files

This commit is contained in:
chenjiahan
2020-04-11 09:17:33 +08:00
committed by neverland
parent 48067f79db
commit 7f84f8a487
140 changed files with 4441 additions and 4723 deletions
+40 -40
View File
@@ -29,16 +29,16 @@ export default {
actions: [
{ name: 'Option' },
{ name: 'Option' },
{ name: 'Option', subname: 'Description' }
]
{ name: 'Option', subname: 'Description' },
],
};
},
methods: {
onSelect(item) {
this.show = false;
Toast(item.name);
}
}
},
},
};
```
@@ -59,15 +59,15 @@ import { Toast } from 'vant';
export default {
data() {
return {
show: false
show: false,
};
},
methods: {
onCancel() {
this.show = false;
Toast('cancel');
}
}
},
},
};
```
@@ -96,10 +96,10 @@ export default {
actions: [
{ name: 'Option', color: '#07c160' },
{ loading: true },
{ name: 'Disabled Option', disabled: true }
]
{ name: 'Disabled Option', disabled: true },
],
};
}
},
};
```
@@ -111,9 +111,9 @@ export default {
</van-action-sheet>
<style>
.content {
padding: 16px 16px 160px;
}
.content {
padding: 16px 16px 160px;
}
</style>
```
@@ -122,40 +122,40 @@ export default {
### Props
| Attribute | Description | Type | Default |
|------|------|------|------|
| v-model (value) | Whether to show ActionSheet | *boolean* | `false` |
| actions | Options | *Action[]* | `[]` |
| title | Title | *string* | - |
| cancel-text | Text of cancel button | *string* | - |
| description `v2.2.8` | Description above the options | *string* | - |
| close-icon `v2.2.13` | Close icon name | *string* | `cross` |
| duration `v2.0.3` | Transition duration, unit second | *number \| string* | `0.3` |
| round `v2.0.9` | Whether to show round corner | *boolean* | `true` |
| overlay | Whether to show overlay | *boolean* | `true` |
| lock-scroll | Whether to lock background scroll | *boolean* | `true` |
| lazy-render | Whether to lazy render util appeared | *boolean* | `true` |
| close-on-popstate `v2.5.3` | Whether to close when popstate | *boolean* | `false` |
| close-on-click-action | Whether to close when click action | *boolean* | `false` |
| close-on-click-overlay | Whether to close when click overlay | *boolean* | `true` |
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | *boolean* | `true` |
| get-container | Return the mount node for ActionSheet | *string \| () => Element* | - |
| --- | --- | --- | --- |
| v-model (value) | Whether to show ActionSheet | _boolean_ | `false` |
| actions | Options | _Action[]_ | `[]` |
| title | Title | _string_ | - |
| cancel-text | Text of cancel button | _string_ | - |
| description `v2.2.8` | Description above the options | _string_ | - |
| close-icon `v2.2.13` | Close icon name | _string_ | `cross` |
| duration `v2.0.3` | Transition duration, unit second | _number \| string_ | `0.3` |
| round `v2.0.9` | Whether to show round corner | _boolean_ | `true` |
| overlay | Whether to show overlay | _boolean_ | `true` |
| lock-scroll | Whether to lock background scroll | _boolean_ | `true` |
| lazy-render | Whether to lazy render util appeared | _boolean_ | `true` |
| close-on-popstate `v2.5.3` | Whether to close when popstate | _boolean_ | `false` |
| close-on-click-action | Whether to close when click action | _boolean_ | `false` |
| close-on-click-overlay | Whether to close when click overlay | _boolean_ | `true` |
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | _boolean_ | `true` |
| get-container | Return the mount node for ActionSheet | _string \| () => Element_ | - |
### Data Structure of Action
| Key | Description | Type |
|------|------|------|
| name | Title | *string* |
| subname | Subtitle | *string* |
| color | Text color | *string* |
| className | className for the option | *any* |
| loading | Whether to be loading status | *boolean* |
| disabled | Whether to be disabled | *boolean* |
| Key | Description | Type |
| --------- | ---------------------------- | --------- |
| name | Title | _string_ |
| subname | Subtitle | _string_ |
| color | Text color | _string_ |
| className | className for the option | _any_ |
| loading | Whether to be loading status | _boolean_ |
| disabled | Whether to be disabled | _boolean_ |
### Events
| Event | Description | Arguments |
|------|------|------|
| select | Triggered when click option | *action: Action, index: number* |
| --- | --- | --- |
| select | Triggered when click option | _action: Action, index: number_ |
| cancel | Triggered when click cancel button | - |
| open | Triggered when open ActionSheet | - |
| close | Triggered when close ActionSheet | - |
+43 -43
View File
@@ -33,8 +33,8 @@ export default {
actions: [
{ name: '选项' },
{ name: '选项' },
{ name: '选项', subname: '描述信息' }
]
{ name: '选项', subname: '描述信息' },
],
};
},
methods: {
@@ -43,9 +43,9 @@ export default {
// 可以通过 close-on-click-action 属性开启自动收起
this.show = false;
Toast(item.name);
}
}
}
},
},
};
```
### 展示取消按钮
@@ -67,16 +67,16 @@ import { Toast } from 'vant';
export default {
data() {
return {
show: false
show: false,
};
},
methods: {
onCancel() {
this.show = false;
Toast('cancel');
}
}
}
},
},
};
```
### 展示描述信息
@@ -112,11 +112,11 @@ export default {
actions: [
{ name: '选项', color: '#07c160' },
{ loading: true },
{ name: '禁用选项', disabled: true }
]
{ name: '禁用选项', disabled: true },
],
};
}
}
},
};
```
### 自定义面板
@@ -129,9 +129,9 @@ export default {
</van-action-sheet>
<style>
.content {
padding: 16px 16px 160px;
}
.content {
padding: 16px 16px 160px;
}
</style>
```
@@ -140,42 +140,42 @@ export default {
### Props
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|------|
| v-model (value) | 是否显示动作面板 | *boolean* | `false` |
| actions | 面板选项列表 | *Action[]* | `[]` |
| title | 顶部标题 | *string* | - |
| cancel-text | 取消按钮文字 | *string* | - |
| description `v2.2.8` | 选项上方的描述信息 | *string* | - |
| close-icon `v2.2.13` | 关闭[图标名称](#/zh-CN/icon)或图片链接 | *string* | `cross` |
| duration `v2.0.3` | 动画时长,单位秒 | *number \| string* | `0.3` |
| round `v2.0.9` | 是否显示圆角 | *boolean* | `true` |
| overlay | 是否显示遮罩层 | *boolean* | `true` |
| lock-scroll | 是否锁定背景滚动 | *boolean* | `true` |
| lazy-render | 是否在显示弹层时才渲染节点 | *boolean* | `true` |
| close-on-popstate `v2.5.3` | 是否在页面回退时自动关闭 | *boolean* | `false` |
| close-on-click-action | 是否在点击选项后关闭 | *boolean* | `false` |
| close-on-click-overlay | 是否在点击遮罩层后关闭 | *boolean* | `true` |
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | *boolean* | `true` |
| get-container | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | *string \| () => Element* | - |
| --- | --- | --- | --- |
| v-model (value) | 是否显示动作面板 | _boolean_ | `false` |
| actions | 面板选项列表 | _Action[]_ | `[]` |
| title | 顶部标题 | _string_ | - |
| cancel-text | 取消按钮文字 | _string_ | - |
| description `v2.2.8` | 选项上方的描述信息 | _string_ | - |
| close-icon `v2.2.13` | 关闭[图标名称](#/zh-CN/icon)或图片链接 | _string_ | `cross` |
| duration `v2.0.3` | 动画时长,单位秒 | _number \| string_ | `0.3` |
| round `v2.0.9` | 是否显示圆角 | _boolean_ | `true` |
| overlay | 是否显示遮罩层 | _boolean_ | `true` |
| lock-scroll | 是否锁定背景滚动 | _boolean_ | `true` |
| lazy-render | 是否在显示弹层时才渲染节点 | _boolean_ | `true` |
| close-on-popstate `v2.5.3` | 是否在页面回退时自动关闭 | _boolean_ | `false` |
| close-on-click-action | 是否在点击选项后关闭 | _boolean_ | `false` |
| close-on-click-overlay | 是否在点击遮罩层后关闭 | _boolean_ | `true` |
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | _boolean_ | `true` |
| get-container | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| () => Element_ | - |
### Action 数据结构
`actions`属性为一个对象数组,数组中的每个对象配置一列,对象可以包含以下值:
| 键名 | 说明 | 类型 |
|------|------|------|
| name | 标题 | *string* |
| subname | 二级标题 | *string* |
| color | 选项文字颜色 | *string* |
| className | 为对应列添加额外的 class | *any* |
| loading | 是否为加载状态 | *boolean* |
| disabled | 是否为禁用状态 | *boolean* |
| 键名 | 说明 | 类型 |
| --------- | ------------------------ | --------- |
| name | 标题 | _string_ |
| subname | 二级标题 | _string_ |
| color | 选项文字颜色 | _string_ |
| className | 为对应列添加额外的 class | _any_ |
| loading | 是否为加载状态 | _boolean_ |
| disabled | 是否为禁用状态 | _boolean_ |
### Events
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| select | 点击选项时触发,禁用或加载状态下不会触发 | *action: Action, index: number* |
| --- | --- | --- |
| select | 点击选项时触发,禁用或加载状态下不会触发 | _action: Action, index: number_ |
| cancel | 点击取消按钮时触发 | - |
| open | 打开面板时触发 | - |
| close | 关闭面板时触发 | - |