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
+23 -27
View File
@@ -44,18 +44,14 @@ export default {
Toast(option.name);
this.showShare = false;
},
}
},
};
```
### Multi Line
```html
<van-share-sheet
v-model="showShare"
title="Share"
:options="options"
/>
<van-share-sheet v-model="showShare" title="Share" :options="options" />
```
```js
@@ -96,37 +92,37 @@ export default {
### Props
| Attribute | Description | Type | Default |
|------|------|------|------|
| options | Share options | *Option[]* | `[]` |
| title | Title | *string* | - |
| cancel-text | Cancel button text | *string* | `'Cancel'` |
| description | Description | *string* | - |
| duration | Transition duration, unit second | *number \| string* | `0.3` |
| 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 | Whether to close when popstate | *boolean* | `true` |
| 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 ShareSheet | *string \| () => Element* | - |
| --- | --- | --- | --- |
| options | Share options | _Option[]_ | `[]` |
| title | Title | _string_ | - |
| cancel-text | Cancel button text | _string_ | `'Cancel'` |
| description | Description | _string_ | - |
| duration | Transition duration, unit second | _number \| string_ | `0.3` |
| 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 | Whether to close when popstate | _boolean_ | `true` |
| 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 ShareSheet | _string \| () => Element_ | - |
### Data Structure of Option
| Key | Description | Type |
|------|------|------|
| name | Option name | *string* |
| icon | Option iconcan be set to `wechat` `weibo` `qq` `link` `qrcode` `poster` or image URL | *string* |
| --- | --- | --- |
| name | Option name | _string_ |
| icon | Option iconcan be set to `wechat` `weibo` `qq` `link` `qrcode` `poster` or image URL | _string_ |
### Events
| Event | Description | Arguments |
|------|------|------|
| select | Triggered when click option | *option: Option, index: number* |
| --- | --- | --- |
| select | Triggered when click option | _option: Option, index: number_ |
| cancel | Triggered when click cancel button | - |
### Slots
| Name | Description |
|------|------|
| title | Custom title |
| Name | Description |
| ----------- | ------------------ |
| title | Custom title |
| description | Custom description |
+36 -27
View File
@@ -50,7 +50,7 @@ export default {
Toast(option.name);
this.showShare = false;
},
}
},
};
```
@@ -102,9 +102,18 @@ export default {
return {
showShare: false,
options: [
{ name: '名称', icon: 'https://img.yzcdn.cn/vant/custom-icon-fire.png' },
{ name: '名称', icon: 'https://img.yzcdn.cn/vant/custom-icon-light.png' },
{ name: '名称', icon: 'https://img.yzcdn.cn/vant/custom-icon-water.png' },
{
name: '名称',
icon: 'https://img.yzcdn.cn/vant/custom-icon-fire.png',
},
{
name: '名称',
icon: 'https://img.yzcdn.cn/vant/custom-icon-light.png',
},
{
name: '名称',
icon: 'https://img.yzcdn.cn/vant/custom-icon-water.png',
},
],
};
},
@@ -129,41 +138,41 @@ export default {
### Props
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|------|
| options | 分享选项 | *Option[]* | `[]` |
| title | 顶部标题 | *string* | - |
| cancel-text | 取消按钮文字 | *string* | `'取消'` |
| description | 标题下方的辅助描述文字 | *string* | - |
| duration | 动画时长,单位秒 | *number \| string* | `0.3` |
| overlay | 是否显示遮罩层 | *boolean* | `true` |
| lock-scroll | 是否锁定背景滚动 | *boolean* | `true` |
| lazy-render | 是否在显示弹层时才渲染内容 | *boolean* | `true` |
| close-on-popstate | 是否在页面回退时自动关闭 | *boolean* | `true` |
| 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* | - |
| --- | --- | --- | --- |
| options | 分享选项 | _Option[]_ | `[]` |
| title | 顶部标题 | _string_ | - |
| cancel-text | 取消按钮文字 | _string_ | `'取消'` |
| description | 标题下方的辅助描述文字 | _string_ | - |
| duration | 动画时长,单位秒 | _number \| string_ | `0.3` |
| overlay | 是否显示遮罩层 | _boolean_ | `true` |
| lock-scroll | 是否锁定背景滚动 | _boolean_ | `true` |
| lazy-render | 是否在显示弹层时才渲染内容 | _boolean_ | `true` |
| close-on-popstate | 是否在页面回退时自动关闭 | _boolean_ | `true` |
| 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_ | - |
### Option 数据结构
`options`属性为一个对象数组,数组中的每个对象配置一列,对象可以包含以下值:
| 键名 | 说明 | 类型 |
|------|------|------|
| name | 分享渠道名称 | *string* |
| icon | 图标,可选值为 `wechat` `weibo` `qq` `link` `qrcode` `poster`,支持传入图片 URL | *string* |
| --- | --- | --- |
| name | 分享渠道名称 | _string_ |
| icon | 图标,可选值为 `wechat` `weibo` `qq` `link` `qrcode` `poster`,支持传入图片 URL | _string_ |
### Events
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| select | 点击分享选项时触发 | *option: Option, index: number* |
| cancel | 点击取消按钮时触发 | - |
| 事件名 | 说明 | 回调参数 |
| ------ | ------------------ | ------------------------------- |
| select | 点击分享选项时触发 | _option: Option, index: number_ |
| cancel | 点击取消按钮时触发 | - |
### Slots
| 名称 | 说明 |
|------|------|
| title | 自定义顶部标题 |
| 名称 | 说明 |
| ----------- | -------------- |
| title | 自定义顶部标题 |
| description | 自定义描述文字 |
## 常见问题