vue element ui dialog对话框弹窗二次封装

vue yekong

再封装

vue element ui dialog pc弹窗添加账户封装

代码

/**
* @Author: 858834013@qq.com
* @Name: popWin
* @Date: 2022-03-20
* @Desc: 弹窗
*/
<template>
  <div class="popWin">
    <div @click="getShow">
      <slot></slot>
    </div>
    <el-dialog
      title=" "
      append-to-body
      :visible.sync="show"
      width="40%">

    </el-dialog>
  </div>
</template>

<script>

export default {
  name: 'popWin',
  components: {},
  props: {
    title: {
      type: String,
      default() {
        return ''
      }
    }
  },
  data() {
    return {
      show: false
    }
  },
  watch: {},
  mounted() {
  },
  methods: {
    getHide() {
      this.show = false
    },
    getShow() {
      this.show = true
    },
  }
}
</script>

<style lang="scss" scoped>

</style>

喜欢