breaking change(SwipeCell): adjust before-close usage

This commit is contained in:
chenjiahan
2020-09-06 10:40:00 +08:00
parent 89a39f05bc
commit d61df0649f
7 changed files with 48 additions and 47 deletions
+8 -8
View File
@@ -78,15 +78,15 @@ export default {
case 'left':
case 'cell':
case 'outside':
instance.close();
break;
return true;
case 'right':
Dialog.confirm({
message: 'Are you sure to delete?',
}).then(() => {
instance.close();
return new Promise((resolve) => {
this.$dialog
.confirm({
message: 'Are you sure to delete?',
})
.then(resolve);
});
break;
}
},
},
@@ -102,7 +102,7 @@ export default {
| name | 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 | _(args) => boolean \| Promise_ | - |
| disabled | Whether to disabled swipe | _boolean_ | `false` |
| stop-propagation | Whether to stop touchmove event propagation | _boolean_ | `false` |