docs: prettier all markdown files
This commit is contained in:
+35
-40
@@ -21,7 +21,7 @@ Vue.use(SwipeCell);
|
||||
<van-cell :border="false" title="Cell" value="Cell Content" />
|
||||
<template #right>
|
||||
<van-button square type="danger" text="Delete" />
|
||||
<van-button square type="primary" text="Collect"/>
|
||||
<van-button square type="primary" text="Collect" />
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
```
|
||||
@@ -39,24 +39,19 @@ Vue.use(SwipeCell);
|
||||
thumb="https://img.yzcdn.cn/vant/cat.jpeg"
|
||||
/>
|
||||
<template #right>
|
||||
<van-button
|
||||
square
|
||||
text="Delete"
|
||||
type="danger"
|
||||
class="delete-button"
|
||||
/>
|
||||
<van-button square text="Delete" type="danger" class="delete-button" />
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
|
||||
<style>
|
||||
.goods-card {
|
||||
margin: 0;
|
||||
background-color: @white;
|
||||
}
|
||||
.goods-card {
|
||||
margin: 0;
|
||||
background-color: @white;
|
||||
}
|
||||
|
||||
.delete-button {
|
||||
height: 100%;
|
||||
}
|
||||
.delete-button {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
@@ -86,15 +81,15 @@ export default {
|
||||
break;
|
||||
case 'right':
|
||||
Dialog.confirm({
|
||||
message: 'Are you sure to delete?'
|
||||
message: 'Are you sure to delete?',
|
||||
}).then(() => {
|
||||
instance.close();
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API
|
||||
@@ -102,43 +97,43 @@ export default {
|
||||
### Props
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| name `v2.0.4` | Identifier of SwipeCell | *number \| string* | - |
|
||||
| left-width | Width of the left swipe area | *number \| string* | `auto` |
|
||||
| right-width | Width of the right swipe area | *number \| string* | `auto` |
|
||||
| before-close `v2.3.0` | Callback function before close | *Function* | - |
|
||||
| disabled | Whether to disabled swipe | *boolean* | `false` |
|
||||
| stop-propagation `v2.1.0` | Whether to stop touchmove event propagation | *boolean* | `false` |
|
||||
| --- | --- | --- | --- |
|
||||
| name `v2.0.4` | Identifier of SwipeCell | _number \| string_ | - |
|
||||
| left-width | Width of the left swipe area | _number \| string_ | `auto` |
|
||||
| right-width | Width of the right swipe area | _number \| string_ | `auto` |
|
||||
| before-close `v2.3.0` | Callback function before close | _Function_ | - |
|
||||
| disabled | Whether to disabled swipe | _boolean_ | `false` |
|
||||
| stop-propagation `v2.1.0` | Whether to stop touchmove event propagation | _boolean_ | `false` |
|
||||
|
||||
### Slots
|
||||
|
||||
| Name | Description |
|
||||
|------|------|
|
||||
| default | custom content |
|
||||
| left | content of left scrollable area |
|
||||
| right | content of right scrollabe area |
|
||||
| Name | Description |
|
||||
| ------- | ------------------------------- |
|
||||
| default | custom content |
|
||||
| left | content of left scrollable area |
|
||||
| right | content of right scrollabe area |
|
||||
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
|------|------|------|
|
||||
| --- | --- | --- |
|
||||
| click | Triggered when clicked | Click positon (`left` `right` `cell` `outside`) |
|
||||
| open | Triggered when opened | { position: 'left' \| 'right' , name: string } |
|
||||
| close | Triggered when closed | { position: string , name: string } |
|
||||
|
||||
### beforeClose Params
|
||||
|
||||
| Attribute | Description | Type |
|
||||
|------|------|------|
|
||||
| name | Name | *string* |
|
||||
| position | Click positon (`left` `right` `cell` `outside`) | *string* |
|
||||
| instance | SwipeCell instance | *SwipeCell* |
|
||||
| Attribute | Description | Type |
|
||||
| --------- | ----------------------------------------------- | ----------- |
|
||||
| name | Name | _string_ |
|
||||
| position | Click positon (`left` `right` `cell` `outside`) | _string_ |
|
||||
| instance | SwipeCell instance | _SwipeCell_ |
|
||||
|
||||
### Methods
|
||||
|
||||
Use [ref](https://vuejs.org/v2/api/#ref) to get SwipeCell instance and call instance methods
|
||||
|
||||
| Name | Description | Attribute | Return value |
|
||||
|------|------|------|------|
|
||||
| open | open SwipeCell | position: `left | right` | - |
|
||||
| close | close SwipeCell | - | - |
|
||||
| Name | Description | Attribute | Return value |
|
||||
| ----- | --------------- | ------------------------ | ------------ |
|
||||
| open | open SwipeCell | position: `left | right` | - |
|
||||
| close | close SwipeCell | - | - |
|
||||
|
||||
@@ -23,7 +23,7 @@ Vue.use(SwipeCell);
|
||||
<van-cell :border="false" title="单元格" value="内容" />
|
||||
<template #right>
|
||||
<van-button square type="danger" text="删除" />
|
||||
<van-button square type="primary" text="收藏"/>
|
||||
<van-button square type="primary" text="收藏" />
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
```
|
||||
@@ -43,24 +43,19 @@ Vue.use(SwipeCell);
|
||||
thumb="https://img.yzcdn.cn/vant/cat.jpeg"
|
||||
/>
|
||||
<template #right>
|
||||
<van-button
|
||||
square
|
||||
text="删除"
|
||||
type="danger"
|
||||
class="delete-button"
|
||||
/>
|
||||
<van-button square text="删除" type="danger" class="delete-button" />
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
|
||||
<style>
|
||||
.goods-card {
|
||||
margin: 0;
|
||||
background-color: @white;
|
||||
}
|
||||
.goods-card {
|
||||
margin: 0;
|
||||
background-color: @white;
|
||||
}
|
||||
|
||||
.delete-button {
|
||||
height: 100%;
|
||||
}
|
||||
.delete-button {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
@@ -94,15 +89,15 @@ export default {
|
||||
break;
|
||||
case 'right':
|
||||
Dialog.confirm({
|
||||
message: '确定删除吗?'
|
||||
message: '确定删除吗?',
|
||||
}).then(() => {
|
||||
instance.close();
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API
|
||||
@@ -110,48 +105,48 @@ export default {
|
||||
### Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| name `v2.0.4` | 标识符,可以在事件参数中获取到 | *number \| string* | - |
|
||||
| left-width | 指定左侧滑动区域宽度,单位为`px` | *number \| string* | `auto` |
|
||||
| right-width | 指定右侧滑动区域宽度,单位为`px` | *number \| string* | `auto` |
|
||||
| before-close `v2.3.0` | 关闭前的回调函数 | *Function* | - |
|
||||
| disabled | 是否禁用滑动 | *boolean* | `false` |
|
||||
| stop-propagation `v2.1.0` | 是否阻止滑动事件冒泡 | *boolean* | `false` |
|
||||
| --- | --- | --- | --- |
|
||||
| name `v2.0.4` | 标识符,可以在事件参数中获取到 | _number \| string_ | - |
|
||||
| left-width | 指定左侧滑动区域宽度,单位为`px` | _number \| string_ | `auto` |
|
||||
| right-width | 指定右侧滑动区域宽度,单位为`px` | _number \| string_ | `auto` |
|
||||
| before-close `v2.3.0` | 关闭前的回调函数 | _Function_ | - |
|
||||
| disabled | 是否禁用滑动 | _boolean_ | `false` |
|
||||
| stop-propagation `v2.1.0` | 是否阻止滑动事件冒泡 | _boolean_ | `false` |
|
||||
|
||||
### Slots
|
||||
|
||||
| 名称 | 说明 |
|
||||
|------|------|
|
||||
| 名称 | 说明 |
|
||||
| ------- | -------------- |
|
||||
| default | 自定义显示内容 |
|
||||
| left | 左侧滑动内容 |
|
||||
| right | 右侧滑动内容 |
|
||||
| left | 左侧滑动内容 |
|
||||
| right | 右侧滑动内容 |
|
||||
|
||||
### Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
|------|------|------|
|
||||
| click | 点击时触发 | 关闭时的点击位置 (`left` `right` `cell` `outside`) |
|
||||
| open | 打开时触发 | { position: 'left' \| 'right' , name: string } |
|
||||
| close | 关闭时触发 | { position: string , name: string } |
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| ------ | ---------- | -------------------------------------------------- |
|
||||
| click | 点击时触发 | 关闭时的点击位置 (`left` `right` `cell` `outside`) |
|
||||
| open | 打开时触发 | { position: 'left' \| 'right' , name: string } |
|
||||
| close | 关闭时触发 | { position: string , name: string } |
|
||||
|
||||
### beforeClose 参数
|
||||
|
||||
beforeClose 的第一个参数为对象,对象中包含以下属性:
|
||||
|
||||
| 参数名 | 说明 | 类型 |
|
||||
|------|------|------|
|
||||
| name | 标识符 | *string* |
|
||||
| position | 关闭时的点击位置 (`left` `right` `cell` `outside`) | *string* |
|
||||
| instance | SwipeCell 实例,用于调用实例方法 | *SwipeCell* |
|
||||
| 参数名 | 说明 | 类型 |
|
||||
| -------- | -------------------------------------------------- | ----------- |
|
||||
| name | 标识符 | _string_ |
|
||||
| position | 关闭时的点击位置 (`left` `right` `cell` `outside`) | _string_ |
|
||||
| instance | SwipeCell 实例,用于调用实例方法 | _SwipeCell_ |
|
||||
|
||||
### 方法
|
||||
|
||||
通过 ref 可以获取到 SwipeCell 实例并调用实例方法,详见[组件实例方法](#/zh-CN/quickstart#zu-jian-shi-li-fang-fa)
|
||||
|
||||
| 方法名 | 说明 | 参数 | 返回值 |
|
||||
|------|------|------|------|
|
||||
| open | 打开单元格侧边栏 | position: `left | right` | - |
|
||||
| close | 收起单元格侧边栏 | - | - |
|
||||
| 方法名 | 说明 | 参数 | 返回值 |
|
||||
| ------ | ---------------- | ------------------------ | ------ |
|
||||
| open | 打开单元格侧边栏 | position: `left | right` | - |
|
||||
| close | 收起单元格侧边栏 | - | - |
|
||||
|
||||
## 常见问题
|
||||
|
||||
|
||||
Reference in New Issue
Block a user