/**
* @desc 打开一个新窗口
* @param {(Object vue实例this)} vue
* @param {Object} params
* @returns {string}
*/
Common.windowOpen = function(vue, params, name = "_blank") {
const routeData = vue.$router.resolve(params);
const opener = window.open(routeData.href, name);
return opener;
};
//父
addHouseholdsTable() {
this.Common.windowOpen(this, { path: '/printChangeOfPovertyAlleviation/ChangeOfPovertyAlleviation', query: {
type: 3
}});
const self = this;
window.addEventListener('message', function(e) {
const data = e.data;
if (data === 'successSaveCheckForm') {
self.getList(); ;
}
});
},
//子
window.opener.postMessage('successSaveCheckForm', '*');
网友评论