fix: rename unmount lifecycles

This commit is contained in:
chenjiahan 2020-08-17 10:40:48 +08:00
parent 3a290ce564
commit 6c85294d35
9 changed files with 9 additions and 9 deletions

View File

@ -63,7 +63,7 @@ export default createComponent({
} }
}, },
beforeDestroy() { beforeUnmount() {
this.pause(); this.pause();
}, },

View File

@ -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();

View File

@ -117,7 +117,7 @@ export default createComponent({
} }
}, },
beforeDestroy() { beforeUnmount() {
if (this.vanForm) { if (this.vanForm) {
this.vanForm.removeField(this); this.vanForm.removeField(this);
} }

View File

@ -77,7 +77,7 @@ export default createComponent({
} }
}, },
beforeDestroy() { beforeUnmount() {
const { $Lazyload } = this; const { $Lazyload } = this;
if ($Lazyload) { if ($Lazyload) {

View File

@ -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,
}; };
} }

View File

@ -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);
}, },
}); });

View File

@ -83,7 +83,7 @@ export function PopupMixin(options = {}) {
} }
}, },
beforeDestroy() { beforeUnmount() {
if (this.opened) { if (this.opened) {
this.removeLock(); this.removeLock();
} }

View File

@ -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) {

View File

@ -50,7 +50,7 @@ export default createComponent({
this.toggleClickable(); this.toggleClickable();
}, },
destroyed() { unmounted() {
this.toggleClickable(); this.toggleClickable();
}, },