一、列表页面
mounted() {
// 监听当前页面的关闭事件
window.onunload = () => {
if (this.childWindow && !this.childWindow.closed) {
this.childWindow.close()
}
}
},
//跳转
handleAdd() {
let routeUrl = this.$router.resolve({
path: '/home/projectContractInput',
query: { type: 'add' },
})
this.childWindow = window.open(routeUrl.href, '_blank')
this.childWindow.onunload = () => {
if (this.childWindow && this.childWindow.closed) {
this.getList()
}
}
},
二、新页面
window.close()