父页面:
<el-button icon="el-icon-plus" @@click="linkUrl('/index/edit')">打开子页面</el-button>
<el-dialog :visible.sync="dialogVisible" fullscree...
父页面:
<el-button icon="el-icon-plus" @@click="linkUrl('/index/edit')">打开子页面</el-button>
<el-dialog :visible.sync="dialogVisible" fullscreen >
<iframe :src="url" frameborder="0" class="dialog-iframe"></iframe>
</el-dialog>
.dialog-iframe{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
}
var vm = new Vue({
el: '#app',
data: {
dialogVisible:false,
url:'',
},
mounted() {
window.closeDialog = this.closeDialog;
},
methods: {
initData: function () {
}
linkUrl: function (url) {
this.dialogVisible=true;
this.url=url;
},
closeDialog(e)
{
this.dialogVisible=false;
if(e=='add')
window.location.reload();
if(e=='edit')
this.initData();
},
},
created: function () {
this.initData();
}
})
子页面调用方法:
parent.closeDialog();
parent.closeDialog('add');
parent.closeDialog('edit');