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

View File

@ -174,7 +174,7 @@ test('incomplate format prop', () => {
expect(wrapper).toMatchSnapshot();
});
test('pause when destroyed', () => {
test('pause when unmounted', () => {
const wrapper = mount(CountDown);
expect(wrapper.vm.counting).toBeTruthy();
wrapper.destroy();

View File

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

View File

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

View File

@ -28,6 +28,6 @@ export function BindEventMixin(handler: BindEventHandler) {
mounted: bind,
activated: bind,
deactivated: unbind,
beforeDestroy: unbind,
beforeUnmount: unbind,
};
}

View File

@ -25,7 +25,7 @@ export const ClickOutsideMixin = (config) => ({
on(document, config.event, this.clickOutsideHandler);
},
beforeDestroy() {
beforeUnmount() {
off(document, config.event, this.clickOutsideHandler);
},
});

View File

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

View File

@ -66,7 +66,7 @@ export default createComponent({
this.bindTouchEvent(this.$el);
},
destroyed() {
unmounted() {
const { children } = this.$parent;
if (children) {

View File

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