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
+21 -21
View File
@@ -26,9 +26,9 @@ Vue.use(SidebarItem);
export default {
data() {
return {
activeKey: 0
activeKey: 0,
};
}
},
};
```
@@ -68,45 +68,45 @@ import { Notify } from 'vant';
export default {
data() {
return {
activeKey: 0
activeKey: 0,
};
},
methods: {
onChange(index) {
Notify({ type: 'primary', message: index });
}
}
}
},
},
};
```
## API
### Sidebar Props
| Attribute | Description | Type | Default |
|------|------|------|------|
| v-model | Index of chosen item | *number \| string* | `0` |
| Attribute | Description | Type | Default |
| --------- | -------------------- | ------------------ | ------- |
| v-model | Index of chosen item | _number \| string_ | `0` |
### Sidebar Events
| Event | Description | Arguments |
|------|------|------|
| Event | Description | Arguments |
| ------ | --------------------------- | ---------------------------- |
| change | Triggered when item changed | index: index of current item |
### SidebarItem Props
| Attribute | Description | Type | Default |
|------|------|------|------|
| title | Content | *string* | `''` |
| dot `v2.2.1` | Whether to show red dot | *boolean* | `false` |
| badge `v2.5.6` | Content of the badge | *number \| string* | `''` |
| disabled `v2.2.0` | Whether to be disabled | *boolean* | `false` |
| url | Link | *string* | - |
| to `v2.0.4` | Target route of the link, same as to of vue-router | *string \| object* | - |
| replace `v2.0.4` | If true, the navigation will not leave a history record | *boolean* | `false` |
| --- | --- | --- | --- |
| title | Content | _string_ | `''` |
| dot `v2.2.1` | Whether to show red dot | _boolean_ | `false` |
| badge `v2.5.6` | Content of the badge | _number \| string_ | `''` |
| disabled `v2.2.0` | Whether to be disabled | _boolean_ | `false` |
| url | Link | _string_ | - |
| to `v2.0.4` | Target route of the link, same as to of vue-router | _string \| object_ | - |
| replace `v2.0.4` | If true, the navigation will not leave a history record | _boolean_ | `false` |
### SidebarItem Events
| Event | Description | Arguments |
|------|------|------|
| Event | Description | Arguments |
| ----- | ------------------------- | ---------------------------- |
| click | Triggered when click item | index: index of current item |
+23 -24
View File
@@ -28,9 +28,9 @@ Vue.use(SidebarItem);
export default {
data() {
return {
activeKey: 0
activeKey: 0,
};
}
},
};
```
@@ -58,7 +58,6 @@ export default {
</van-sidebar>
```
### 监听切换事件
设置`change`方法来监听切换导航项时的事件
@@ -77,46 +76,46 @@ import { Notify } from 'vant';
export default {
data() {
return {
activeKey: 0
activeKey: 0,
};
},
methods: {
onChange(index) {
Notify({ type: 'primary', message: index });
}
}
}
},
},
};
```
## API
### Sidebar Props
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|------|
| v-model `v2.0.4` | 当前导航项的索引 | *number \| string* | `0` |
| 参数 | 说明 | 类型 | 默认值 |
| ---------------- | ---------------- | ------------------ | ------ |
| v-model `v2.0.4` | 当前导航项的索引 | _number \| string_ | `0` |
### Sidebar Events
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| 事件名 | 说明 | 回调参数 |
| ------ | ---------------- | ----------------------- |
| change | 切换导航项时触发 | index: 当前导航项的索引 |
### SidebarItem Props
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|------|
| title | 内容 | *string* | `''` |
| dot `v2.2.1` | 是否显示右上角小红点 | *boolean* | `false` |
| badge `v2.5.6` | 图标右上角徽标的内容 | *number \| string* | - |
| info | 图标右上角徽标的内容(已废弃,请使用 badge 属性) | *number \| string* | - |
| disabled `v2.2.0` | 是否禁用该项 | *boolean* | `false` |
| url | 点击后跳转的链接地址 | *string* | - |
| to `v2.0.4` | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | *string \| object* | - |
| replace `v2.0.4` | 是否在跳转时替换当前页面历史 | *boolean* | `false` |
| --- | --- | --- | --- |
| title | 内容 | _string_ | `''` |
| dot `v2.2.1` | 是否显示右上角小红点 | _boolean_ | `false` |
| badge `v2.5.6` | 图标右上角徽标的内容 | _number \| string_ | - |
| info | 图标右上角徽标的内容(已废弃,请使用 badge 属性) | _number \| string_ | - |
| disabled `v2.2.0` | 是否禁用该项 | _boolean_ | `false` |
| url | 点击后跳转的链接地址 | _string_ | - |
| to `v2.0.4` | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | _string \| object_ | - |
| replace `v2.0.4` | 是否在跳转时替换当前页面历史 | _boolean_ | `false` |
### SidebarItem Events
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| click | 点击时触发 | index: 当前导航项的索引 |
| 事件名 | 说明 | 回调参数 |
| ------ | ---------- | ----------------------- |
| click | 点击时触发 | index: 当前导航项的索引 |