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>

 

posted @ 2019-11-15 10:15  一路向北中  阅读(4654)  评论(0编辑  收藏  举报