mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-09-01 21:59:45 +08:00
fix: rename unmount lifecycles
This commit is contained in:
parent
3a290ce564
commit
6c85294d35
@ -63,7 +63,7 @@ export default createComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.pause();
|
this.pause();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ test('incomplate format prop', () => {
|
|||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('pause when destroyed', () => {
|
test('pause when unmounted', () => {
|
||||||
const wrapper = mount(CountDown);
|
const wrapper = mount(CountDown);
|
||||||
expect(wrapper.vm.counting).toBeTruthy();
|
expect(wrapper.vm.counting).toBeTruthy();
|
||||||
wrapper.destroy();
|
wrapper.destroy();
|
||||||
|
@ -117,7 +117,7 @@ export default createComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
if (this.vanForm) {
|
if (this.vanForm) {
|
||||||
this.vanForm.removeField(this);
|
this.vanForm.removeField(this);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ export default createComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
const { $Lazyload } = this;
|
const { $Lazyload } = this;
|
||||||
|
|
||||||
if ($Lazyload) {
|
if ($Lazyload) {
|
||||||
|
@ -28,6 +28,6 @@ export function BindEventMixin(handler: BindEventHandler) {
|
|||||||
mounted: bind,
|
mounted: bind,
|
||||||
activated: bind,
|
activated: bind,
|
||||||
deactivated: unbind,
|
deactivated: unbind,
|
||||||
beforeDestroy: unbind,
|
beforeUnmount: unbind,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ export const ClickOutsideMixin = (config) => ({
|
|||||||
on(document, config.event, this.clickOutsideHandler);
|
on(document, config.event, this.clickOutsideHandler);
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
off(document, config.event, this.clickOutsideHandler);
|
off(document, config.event, this.clickOutsideHandler);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -83,7 +83,7 @@ export function PopupMixin(options = {}) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
if (this.opened) {
|
if (this.opened) {
|
||||||
this.removeLock();
|
this.removeLock();
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ export default createComponent({
|
|||||||
this.bindTouchEvent(this.$el);
|
this.bindTouchEvent(this.$el);
|
||||||
},
|
},
|
||||||
|
|
||||||
destroyed() {
|
unmounted() {
|
||||||
const { children } = this.$parent;
|
const { children } = this.$parent;
|
||||||
|
|
||||||
if (children) {
|
if (children) {
|
||||||
|
@ -50,7 +50,7 @@ export default createComponent({
|
|||||||
this.toggleClickable();
|
this.toggleClickable();
|
||||||
},
|
},
|
||||||
|
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.toggleClickable();
|
this.toggleClickable();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user