Vue 组件窗口弹出
<EditSpecial :panelShow.sync="panelShow" @hidePanel=hidePanel></EditSpecial>
<template> <div v-show="panelShow"> <el-dialog title="专题编辑" :visible.sync="isShow" :before-close="hidePanel"> <el-button @click="hidePanel">关闭弹窗</el-button> </el-dialog> </div> </template> <script> export default { name: "EditSpecial", data () { return { isShow: this.panelShow } }, props: { panelShow: {type: Boolean} }, watch:{ panelShow(val){ this.isShow = val; } }, methods: { hidePanel () { this.$emit('hidePanel') } } } </script> <style scoped> </style>