1、Vue中把要执行的方法挂到window上
created() {
let _this=this;
window.reloadTable=_this.reloadTable;
},
2、普通js内调用方法
if (typeof window.opener.reloadTable == "function") {
window.opener.reloadTable();
}
```
文章讲述了在Vue组件中如何将`reloadTable`方法挂载到全局window对象,以及在JavaScript中如何在不同窗口间调用这个方法。
1、Vue中把要执行的方法挂到window上
created() {
let _this=this;
window.reloadTable=_this.reloadTable;
},
2、普通js内调用方法
if (typeof window.opener.reloadTable == "function") {
window.opener.reloadTable();
}
```

被折叠的 条评论
为什么被折叠?