月度归档:2022年05月

Element-ui 使用经验总结

el-popover

<el-popover
  placement="top"
  width="160"
  trigger="hover"
  ref="popover"
  v-model="visible">
  <p>确认要清空所有互斥关系吗?</p>
  <div style="text-align: right; margin: 0">
    <el-button size="mini" type="text" @click="hidePopover">取消</el-button>
    <el-button type="primary" size="mini" @click="confirm">确定</el-button>
  </div>
  <i class="el-icon-delete" slot="reference"></i>
</el-popover>
export default {
    methods: {
        confirm() {
            this.hidePopover()
        },
        hidePopover() {
            this.visible = false;
            this.$refs['popover'].doClose()
        },
    }
}