js监听iframe window事件 :
const iframe = document.querySelector('iframe');
iframe.contentWindow.NativeFunction = function NativeFunction(para) {}
vue keepAlive页面销毁:
方法用在keepAlive页面返回时。自测没问题。参考的某大神的,github来源忘了。有问题拍砖
例:A->B(B keepAlive=true),B->C,C->B数据保留,B->A B销毁。A->B B为新页面。
const caches = this.$vnode.parent.componentInstance.cache;
for (const key in caches) {if (caches[key].name == "页面name") {delete caches[key];}
}
this.$destroy();