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
+13 -9
View File
@@ -2,6 +2,7 @@
import { createNamespace } from '../utils';
import { range } from '../utils/format/number';
import { preventDefault } from '../utils/dom/event';
import { callInterceptor } from '../utils/interceptor';
// Mixins
import { TouchMixin } from '../mixins/touch';
@@ -167,15 +168,18 @@ export default createComponent({
this.$emit('click', position);
if (this.opened && !this.lockClick) {
if (this.beforeClose) {
this.beforeClose({
position,
name: this.name,
instance: this,
});
} else {
this.close(position);
}
callInterceptor({
interceptor: this.beforeClose,
args: [
{
position,
name: this.name,
},
],
done: () => {
this.close(position);
},
});
}
},