mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[new feature] SwipeCell: add stop-propagation prop (#3952)
This commit is contained in:
parent
632e4c1d31
commit
04616b8a5f
@ -77,6 +77,7 @@ export default {
|
|||||||
| disabled | Whether to disabled swipe | `boolean` | `false` |
|
| disabled | Whether to disabled swipe | `boolean` | `false` |
|
||||||
| left-width | Width of the left swipe area | `number` | `auto` |
|
| left-width | Width of the left swipe area | `number` | `auto` |
|
||||||
| right-width | Width of the right swipe area | `number` | `auto` |
|
| right-width | Width of the right swipe area | `number` | `auto` |
|
||||||
|
| stop-propagation | Whether to stop touchmove event propagation | `boolean` | `false` |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ export default {
|
|||||||
| disabled | 是否禁用滑动 | `boolean` | `false` | - |
|
| disabled | 是否禁用滑动 | `boolean` | `false` | - |
|
||||||
| left-width | 指定左侧滑动区域宽度 | `number` | `auto` | - |
|
| left-width | 指定左侧滑动区域宽度 | `number` | `auto` | - |
|
||||||
| right-width | 指定右侧滑动区域宽度 | `number` | `auto` | - |
|
| right-width | 指定右侧滑动区域宽度 | `number` | `auto` | - |
|
||||||
|
| stop-propagation | 是否阻止滑动事件冒泡 | `boolean` | `false` | 2.1.0 |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ export default createComponent({
|
|||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
leftWidth: Number,
|
leftWidth: Number,
|
||||||
rightWidth: Number,
|
rightWidth: Number,
|
||||||
|
stopPropagation: Boolean,
|
||||||
name: {
|
name: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: ''
|
default: ''
|
||||||
@ -121,7 +122,7 @@ export default createComponent({
|
|||||||
this.touchMove(event);
|
this.touchMove(event);
|
||||||
|
|
||||||
if (this.direction === 'horizontal') {
|
if (this.direction === 'horizontal') {
|
||||||
preventDefault(event, true);
|
preventDefault(event, this.stopPropagation);
|
||||||
this.swipeMove(this.deltaX + this.startOffset);
|
this.swipeMove(this.deltaX + this.startOffset);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user