/**
*  @Author      LiuShaolong
*  @Description Popover
*  @CreateDate  2019年10月30日 22:21
*/
<template>
  <el-popover :ref="popoverRef" class="el-dropdown">
    <p><i class="el-icon-warning"></i>{{ content ? content : '确认' + name + '?' }}</p>
    <slot name="content"></slot>
    <div class="footer-button">
      <el-button type="text" @click="close">取消</el-button>
      <el-button type="primary" @click="submit">确定</el-button>
    </div>
    <el-button v-bind="$attrs" :type="type" :disabled="disabled" v-permission="permission" slot="reference">
      {{name}}
    </el-button>
  </el-popover>
</template>
<script>

  export default {
    name: "ZyPopover",
    props: {
      content: {type: String, default: ''},
      popoverRef: {type: String, default: 'thisPopover'},
      name: {type: String, default: '删除'},
      type: {type: String, default: 'primary'},
      disabled: {type: Boolean, default: false},
      permission: {type: String,}
    },
    computed: {},
    data() {
      return {}
    },
    watch: {},
    mounted() {
    },
    methods: {
      close() {
        this.$refs[this.popoverRef].doClose();
      },
      submit() {
        this.$emit('submit');
        this.close();
      }
    }
  }
</script>
<style scoped>
  .el-icon-warning {
    color: #e6a23c;
    margin-right: 7px
  }

  .footer-button {
    text-align: right;
    margin-top: 8px;
  }

  p {
    margin: 5px 0;
  }
</style>
