feat(SwipeCell): add name prop (#2062)

This commit is contained in:
ShuaiKang Zhang 2019-09-19 16:52:37 +08:00 committed by neverland
parent aa32f2441e
commit d1169348ae
2 changed files with 7 additions and 2 deletions

View File

@ -63,6 +63,7 @@ Page({
| 参数 | 说明 | 类型 | 默认值 | 版本 | | 参数 | 说明 | 类型 | 默认值 | 版本 |
|------|------|------|------|------| |------|------|------|------|------|
| name | 标识符,可以在 close 事件的参数中获取到 | *string \| number* | - | - |
| left-width | 左侧滑动区域宽度 | *number* | `0` | - | | left-width | 左侧滑动区域宽度 | *number* | `0` | - |
| right-width | 右侧滑动区域宽度 | *number* | `0` | - | | right-width | 右侧滑动区域宽度 | *number* | `0` | - |
| async-close | 是否异步关闭 | *boolean* | `false` | - | | async-close | 是否异步关闭 | *boolean* | `false` | - |

View File

@ -15,7 +15,11 @@ VantComponent({
type: Number, type: Number,
value: 0 value: 0
}, },
asyncClose: Boolean asyncClose: Boolean,
name: {
type: [Number, String],
value: ''
}
}, },
mixins: [touch], mixins: [touch],
@ -132,7 +136,7 @@ VantComponent({
} }
if (this.data.asyncClose) { if (this.data.asyncClose) {
this.$emit('close', { position, instance: this }); this.$emit('close', { position, instance: this, name: this.data.name });
} else { } else {
this.swipeMove(0); this.swipeMove(0);
} }