feat(SwipeCell): support dynamic set width (#2607)

This commit is contained in:
Jake 2019-12-27 14:34:06 +08:00 committed by neverland
parent 954bb21d40
commit 10f903f8bb

View File

@ -11,11 +11,21 @@ VantComponent({
disabled: Boolean, disabled: Boolean,
leftWidth: { leftWidth: {
type: Number, type: Number,
value: 0 value: 0,
observer(leftWidth = 0) {
if (this.offset > 0) {
this.swipeMove(leftWidth);
}
}
}, },
rightWidth: { rightWidth: {
type: Number, type: Number,
value: 0 value: 0,
observer(rightWidth = 0) {
if (this.offset < 0) {
this.swipeMove(-rightWidth);
}
}
}, },
asyncClose: Boolean, asyncClose: Boolean,
name: { name: {