1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<template>
<!-- 开启confirm时,操作之前会先调动确认窗口 -->
<el-popover
placement="top"
width="160"
v-model="visible">
<p>{{message}}</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="change">确定</el-button>
</div>
<label slot="reference">
<slot></slot>
</label>
</el-popover>
</template>
<script>
export default {
props: {
message: {
type: String,
default: '确认操作?',
}
},
methods: {
change(e) {
this.visible = false;
this.$emit("confirm",e);
}
},
data() {
return {
visible: false,
}
}
}
</script>