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` |
|
||||
| left-width | Width of the left 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
|
||||
|
||||
|
@ -82,6 +82,7 @@ export default {
|
||||
| disabled | 是否禁用滑动 | `boolean` | `false` | - |
|
||||
| left-width | 指定左侧滑动区域宽度 | `number` | `auto` | - |
|
||||
| right-width | 指定右侧滑动区域宽度 | `number` | `auto` | - |
|
||||
| stop-propagation | 是否阻止滑动事件冒泡 | `boolean` | `false` | 2.1.0 |
|
||||
|
||||
### Slots
|
||||
|
||||
|
@ -21,6 +21,7 @@ export default createComponent({
|
||||
disabled: Boolean,
|
||||
leftWidth: Number,
|
||||
rightWidth: Number,
|
||||
stopPropagation: Boolean,
|
||||
name: {
|
||||
type: [Number, String],
|
||||
default: ''
|
||||
@ -121,7 +122,7 @@ export default createComponent({
|
||||
this.touchMove(event);
|
||||
|
||||
if (this.direction === 'horizontal') {
|
||||
preventDefault(event, true);
|
||||
preventDefault(event, this.stopPropagation);
|
||||
this.swipeMove(this.deltaX + this.startOffset);
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user