feat(SwipeCell): left-width、right-width can be string

This commit is contained in:
陈嘉涵 2020-01-31 10:07:04 +08:00
parent e9f96393f9
commit 526202cc40
3 changed files with 9 additions and 9 deletions

View File

@ -103,10 +103,10 @@ export default {
| 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` |
| left-width | Width of the left swipe area | *number* | `auto` |
| right-width | Width of the right swipe area | *number* | `auto` |
| stop-propagation `v2.1.0` | Whether to stop touchmove event propagation | *boolean* | `false` |
### Slots

View File

@ -111,10 +111,10 @@ export default {
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|------|
| 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` |
| left-width | 指定左侧滑动区域宽度 | *number* | `auto` |
| right-width | 指定右侧滑动区域宽度 | *number* | `auto` |
| stop-propagation `v2.1.0` | 是否阻止滑动事件冒泡 | *boolean* | `false` |
### Slots

View File

@ -23,10 +23,10 @@ export default createComponent({
// @deprecated
// should be removed in next major version, use beforeClose instead
onClose: Function,
beforeClose: Function,
disabled: Boolean,
leftWidth: Number,
rightWidth: Number,
leftWidth: [Number, String],
rightWidth: [Number, String],
beforeClose: Function,
stopPropagation: Boolean,
name: {
type: [Number, String],
@ -43,11 +43,11 @@ export default createComponent({
computed: {
computedLeftWidth() {
return this.leftWidth || this.getWidthByRef('left');
return +this.leftWidth || this.getWidthByRef('left');
},
computedRightWidth() {
return this.rightWidth || this.getWidthByRef('right');
return +this.rightWidth || this.getWidthByRef('right');
},
},