mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-08-07 21:19:45 +08:00
feat(SwipeCell): left-width、right-width can be string
This commit is contained in:
parent
e9f96393f9
commit
526202cc40
@ -103,10 +103,10 @@ export default {
|
|||||||
| Attribute | Description | Type | Default |
|
| Attribute | Description | Type | Default |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| name `v2.0.4` | Identifier of SwipeCell | *number \| string* | - |
|
| 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* | - |
|
| before-close `v2.3.0` | Callback function before close | *Function* | - |
|
||||||
| disabled | Whether to disabled swipe | *boolean* | `false` |
|
| 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` |
|
| stop-propagation `v2.1.0` | Whether to stop touchmove event propagation | *boolean* | `false` |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
@ -111,10 +111,10 @@ export default {
|
|||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| name `v2.0.4` | 标识符,可以在事件参数中获取到 | *number \| string* | - |
|
| name `v2.0.4` | 标识符,可以在事件参数中获取到 | *number \| string* | - |
|
||||||
|
| left-width | 指定左侧滑动区域宽度,单位为`px` | *number \| string* | `auto` |
|
||||||
|
| right-width | 指定右侧滑动区域宽度,单位为`px` | *number \| string* | `auto` |
|
||||||
| before-close `v2.3.0` | 关闭前的回调函数 | *Function* | - |
|
| before-close `v2.3.0` | 关闭前的回调函数 | *Function* | - |
|
||||||
| disabled | 是否禁用滑动 | *boolean* | `false` |
|
| disabled | 是否禁用滑动 | *boolean* | `false` |
|
||||||
| left-width | 指定左侧滑动区域宽度 | *number* | `auto` |
|
|
||||||
| right-width | 指定右侧滑动区域宽度 | *number* | `auto` |
|
|
||||||
| stop-propagation `v2.1.0` | 是否阻止滑动事件冒泡 | *boolean* | `false` |
|
| stop-propagation `v2.1.0` | 是否阻止滑动事件冒泡 | *boolean* | `false` |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
@ -23,10 +23,10 @@ export default createComponent({
|
|||||||
// @deprecated
|
// @deprecated
|
||||||
// should be removed in next major version, use beforeClose instead
|
// should be removed in next major version, use beforeClose instead
|
||||||
onClose: Function,
|
onClose: Function,
|
||||||
beforeClose: Function,
|
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
leftWidth: Number,
|
leftWidth: [Number, String],
|
||||||
rightWidth: Number,
|
rightWidth: [Number, String],
|
||||||
|
beforeClose: Function,
|
||||||
stopPropagation: Boolean,
|
stopPropagation: Boolean,
|
||||||
name: {
|
name: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
@ -43,11 +43,11 @@ export default createComponent({
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
computedLeftWidth() {
|
computedLeftWidth() {
|
||||||
return this.leftWidth || this.getWidthByRef('left');
|
return +this.leftWidth || this.getWidthByRef('left');
|
||||||
},
|
},
|
||||||
|
|
||||||
computedRightWidth() {
|
computedRightWidth() {
|
||||||
return this.rightWidth || this.getWidthByRef('right');
|
return +this.rightWidth || this.getWidthByRef('right');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user