chore: update destory to unmount
parent
7555f2c65b
commit
585bb7495b
|
@ -24,7 +24,7 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.autoDestroy) {
|
||||
this.removeContainer();
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.removeContainer();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -46,7 +46,7 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
const { visible } = this.$props;
|
||||
// 离开时不会 render, 导到离开时数值不变,改用 func 。。
|
||||
openCount = visible && openCount ? openCount - 1 : openCount;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
const createRef = fn => {
|
||||
return {
|
||||
onVnodeBeforeMounted: vnode => {
|
||||
onVnodeBeforeMount: vnode => {
|
||||
fn(vnode.component || vnode.el, vnode.key);
|
||||
},
|
||||
onVnodeUpdated: vnode => {
|
||||
fn(vnode.component || vnode.el, vnode.key);
|
||||
},
|
||||
onVnodeDestroyed: vnode => {
|
||||
fn(vnode.component || vnode.el, vnode.key);
|
||||
onVnodeUnmounted: vnode => {
|
||||
fn(null, vnode.key);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
|
@ -44,7 +44,7 @@ export default function connect(mapStateToProps) {
|
|||
this.trySubscribe();
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.tryUnsubscribe();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -37,7 +37,7 @@ export default {
|
|||
configProvider,
|
||||
};
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.instance) {
|
||||
this.instance.cancel();
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ const Affix = {
|
|||
this.updatePosition();
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
clearTimeout(this.timeout);
|
||||
removeObserveTarget(this);
|
||||
this.updatePosition.cancel();
|
||||
|
|
|
@ -152,7 +152,7 @@ export default {
|
|||
this.updateInk();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.scrollEvent) {
|
||||
this.scrollEvent.remove();
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ export default {
|
|||
this.antAnchor.registerLink(this.href);
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.antAnchor.unregisterLink(this.href);
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -44,7 +44,7 @@ const BackTop = {
|
|||
});
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.scrollEvent) {
|
||||
this.scrollEvent.remove();
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.clearTimeout();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -50,7 +50,7 @@ export default {
|
|||
updated() {
|
||||
this.fixTwoCNChar();
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.delayTimeout) {
|
||||
clearTimeout(this.delayTimeout);
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ const Carousel = {
|
|||
// https://github.com/ant-design/ant-design/issues/7191
|
||||
this.innerSlider = this.$refs.slick && this.$refs.slick.innerSlider;
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
const { autoplay } = this;
|
||||
if (autoplay) {
|
||||
window.removeEventListener('resize', this.onWindowResized);
|
||||
|
|
|
@ -53,7 +53,7 @@ export default {
|
|||
'`value` is not validate prop, do you mean `checked`?',
|
||||
);
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
const { value, checkboxGroupContext: checkboxGroup = {} } = this;
|
||||
if (checkboxGroup.cancelValue) {
|
||||
checkboxGroup.cancelValue(value);
|
||||
|
|
|
@ -194,7 +194,7 @@ const Descriptions = {
|
|||
});
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
ResponsiveObserve.unsubscribe(this.token);
|
||||
},
|
||||
render() {
|
||||
|
|
|
@ -85,7 +85,7 @@ const Drawer = {
|
|||
this.preVisible = this.visible;
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
// unmount drawer in child, clear push.
|
||||
if (this.parentDrawer) {
|
||||
this.parentDrawer.pull();
|
||||
|
|
|
@ -121,7 +121,7 @@ export default {
|
|||
this.initialValue = cloneDeep(this.fieldValue);
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
const { removeField } = this.FormContext;
|
||||
removeField && removeField(this);
|
||||
},
|
||||
|
|
|
@ -106,7 +106,7 @@ export default {
|
|||
this.collectContext();
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.collectFormItemContext(this.$vnode && this.$vnode.context, 'delete');
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
@ -48,7 +48,7 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
ResponsiveObserve.unsubscribe(this.token);
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -82,7 +82,7 @@ export default {
|
|||
this.clearPasswordValueAttribute();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.removePasswordTimeout) {
|
||||
clearTimeout(this.removePasswordTimeout);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ const ResizableTextArea = {
|
|||
mounted() {
|
||||
this.resizeTextarea();
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
raf.cancel(this.nextFrameActionId);
|
||||
raf.cancel(this.resizeFrameId);
|
||||
},
|
||||
|
|
|
@ -145,7 +145,7 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.mql) {
|
||||
this.mql.removeListener(this.responsiveHandler);
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ const LocaleProvider = {
|
|||
setMomentLocale(locale);
|
||||
changeConfirmLocale(locale && locale.Modal);
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
changeConfirmLocale();
|
||||
},
|
||||
render() {
|
||||
|
|
|
@ -64,7 +64,7 @@ const Menu = {
|
|||
updated() {
|
||||
this.propsUpdating = false;
|
||||
},
|
||||
// beforeDestroy() {
|
||||
// beforeUnmount() {
|
||||
// raf.cancel(this.mountRafId);
|
||||
// },
|
||||
watch: {
|
||||
|
|
|
@ -24,7 +24,7 @@ export default {
|
|||
this.timeoutId = setTimeout(() => this.$el.focus());
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
clearTimeout(this.timeoutId);
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -66,7 +66,7 @@ export default {
|
|||
this.updateSpinning();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.cancelExistingSpin();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -28,7 +28,7 @@ export default {
|
|||
this.syncTimer();
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.stopTimer();
|
||||
},
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ export default {
|
|||
this.subscribe();
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.unsubscribe) {
|
||||
this.unsubscribe();
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ export default {
|
|||
this.subscribe();
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.unsubscribe) {
|
||||
this.unsubscribe();
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ export default function createBodyRow(Component = 'tr') {
|
|||
this.subscribe();
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.unsubscribe) {
|
||||
this.unsubscribe();
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ export default {
|
|||
// }
|
||||
// });
|
||||
// },
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
clearTimeout(this.triggerScrollTimer);
|
||||
// if (this.scrollEvent) {
|
||||
// this.scrollEvent.remove();
|
||||
|
|
|
@ -46,7 +46,7 @@ const ListBody = {
|
|||
});
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
raf.cancel(this.mountId);
|
||||
raf.cancel(this.lazyId);
|
||||
},
|
||||
|
|
|
@ -48,7 +48,7 @@ export default {
|
|||
this.sFileList = val || [];
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.clearProgressTimer();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -94,7 +94,7 @@ export default {
|
|||
this.prevProps = { ...this.$props, align: clonedeep(this.$props.align) };
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.stopMonitorWindowResize();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -80,7 +80,7 @@ const Picker = {
|
|||
this.preSOpen = this.sOpen;
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
clearTimeout(this.focusTimeout);
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -96,7 +96,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
const { visible, getOpenCount } = this;
|
||||
if ((visible || this.inTransition) && !getOpenCount()) {
|
||||
this.switchScrollingEffect();
|
||||
|
|
|
@ -130,7 +130,7 @@ const Drawer = {
|
|||
}
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
delete currentDrawer[this.drawerId];
|
||||
delete this.isOpenChange;
|
||||
if (this.container) {
|
||||
|
|
|
@ -174,7 +174,7 @@ export default {
|
|||
this.updatedFunc();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.stop();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -73,7 +73,7 @@ export default {
|
|||
this.scrollHander = addEventListener(eventNode, 'scroll', this.lazyLoadHandler);
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this._mounted = false;
|
||||
if (this.lazyLoadHandler.cancel) {
|
||||
this.lazyLoadHandler.cancel();
|
||||
|
|
|
@ -80,7 +80,7 @@ const DOMWrap = {
|
|||
});
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.resizeObserver) {
|
||||
this.resizeObserver.disconnect();
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ const MenuItem = {
|
|||
});
|
||||
this.callRef();
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
const props = this.$props;
|
||||
this.__emit('destroy', props.eventKey);
|
||||
},
|
||||
|
|
|
@ -102,7 +102,7 @@ const SubMenu = {
|
|||
});
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
const { eventKey } = this;
|
||||
this.__emit('destroy', eventKey);
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.clearCloseTimer();
|
||||
this.willDestroy = true; // beforeDestroy调用后依然会触发onMouseleave事件
|
||||
this.willDestroy = true; // beforeUnmount调用后依然会触发onMouseleave事件
|
||||
},
|
||||
methods: {
|
||||
close(e) {
|
||||
|
|
|
@ -23,7 +23,7 @@ const VueResizeObserver = {
|
|||
updated() {
|
||||
this.onComponentUpdated();
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.destroyObserver();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -63,7 +63,7 @@ export default {
|
|||
this.lastInputValue = props.inputValue;
|
||||
this.prevVisible = this.visible;
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.rafInstance) {
|
||||
raf.cancel(this.rafInstance);
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ const Select = {
|
|||
this.forcePopupAlign();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.clearFocusTime();
|
||||
this.clearBlurTime();
|
||||
this.clearComboboxTime();
|
||||
|
|
|
@ -82,7 +82,7 @@ export default {
|
|||
this.setDropdownWidth();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.cancelRafInstance();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -489,7 +489,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.animationEndCallback) {
|
||||
clearTimeout(this.animationEndCallback);
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this._responsiveMediaHandlers.forEach(function(obj) {
|
||||
enquire.unregister(obj.query, obj.handler);
|
||||
});
|
||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
|||
// so we listen on document here.
|
||||
this.onMouseUpListener = addEventListener(document, 'mouseup', this.handleMouseUp);
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.onMouseUpListener) {
|
||||
this.onMouseUpListener.remove();
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ export default function createSlider(Component) {
|
|||
}
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.$nextTick(() => {
|
||||
// if (super.componentWillUnmount) super.componentWillUnmount()
|
||||
this.removeDocumentEvents();
|
||||
|
|
|
@ -46,7 +46,7 @@ export default {
|
|||
this.calcStepOffsetWidth();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.calcTimeout) {
|
||||
clearTimeout(this.calcTimeout);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ const ExpandableRow = {
|
|||
// children: PropTypes.func.isRequired,
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.handleDestroy();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -203,7 +203,7 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.resizeEvent) {
|
||||
this.resizeEvent.remove();
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.resizeObserver) {
|
||||
this.resizeObserver.disconnect();
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.destroy = true;
|
||||
raf.cancel(this.sentinelId);
|
||||
},
|
||||
|
|
|
@ -78,7 +78,7 @@ const TreeNode = {
|
|||
updated() {
|
||||
this.syncLoadData(this.$props);
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
const {
|
||||
eventKey,
|
||||
vcTree: { registerTreeNode },
|
||||
|
|
|
@ -62,7 +62,7 @@ export default {
|
|||
this.setStretchSize();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (this.$el.parentNode) {
|
||||
this.$el.parentNode.removeChild(this.$el);
|
||||
} else if (this.$el.remove) {
|
||||
|
|
|
@ -125,7 +125,7 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this.clearDelayTimer();
|
||||
this.clearOutsideHandler();
|
||||
clearTimeout(this.mouseDownTimeout);
|
||||
|
|
|
@ -45,7 +45,7 @@ const AjaxUploader = {
|
|||
mounted() {
|
||||
this._isMounted = true;
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
this._isMounted = false;
|
||||
this.abort();
|
||||
},
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
<template>
|
||||
<a-empty />
|
||||
<div>
|
||||
<a-button @click="show = !show">按钮</a-button>
|
||||
<a-tooltip class="ddddd" style="color: blue" v-if="show">
|
||||
<template v-slot:title>prompt text</template>
|
||||
<a-button class="test" style="color: red">Tooltip will show when mouse enter.</a-button>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: true,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue