| 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 | | <template> |  |   <el-popover |  |     v-bind="$attrs" |  |     v-model="visible" |  |     trigger="click" |  |   > |  |   <div class="el-popconfirm"> |  |     <p class="el-popconfirm__main"> |  |     <i |  |       v-if="!hideIcon" |  |       :class="icon" |  |       class="el-popconfirm__icon" |  |       :style="{color: iconColor}" |  |     ></i> |  |       {{title}} |  |     </p> |  |     <div class="el-popconfirm__action"> |  |       <el-button  |  |         size="mini"  |  |         :type="cancelButtonType"  |  |         @click="cancel" |  |       > |  |         {{ displayCancelButtonText }} |  |       </el-button> |  |       <el-button  |  |         size="mini"  |  |         :type="confirmButtonType"  |  |         @click="confirm" |  |       > |  |         {{ displayConfirmButtonText }} |  |       </el-button> |  |     </div> |  |   </div> |  |   <slot name="reference" slot="reference"></slot> |  | </el-popover> |  | </template> |  |   |  | <script> |  | import ElPopover from 'element-ui/packages/popover'; |  | import ElButton from 'element-ui/packages/button'; |  | import {t} from 'element-ui/src/locale'; |  |   |  | export default { |  |   name: 'ElPopconfirm', |  |   props: { |  |     title: { |  |       type: String |  |     }, |  |     confirmButtonText: { |  |       type: String |  |     }, |  |     cancelButtonText: { |  |       type: String |  |     }, |  |     confirmButtonType: { |  |       type: String, |  |       default: 'primary' |  |     }, |  |     cancelButtonType: { |  |       type: String, |  |       default: 'text' |  |     }, |  |     icon: { |  |       type: String, |  |       default: 'el-icon-question' |  |     }, |  |     iconColor: { |  |       type: String, |  |       default: '#f90' |  |     }, |  |     hideIcon: { |  |       type: Boolean, |  |       default: false |  |     } |  |   }, |  |   components: { |  |     ElPopover, |  |     ElButton |  |   }, |  |   data() { |  |     return { |  |       visible: false |  |     }; |  |   }, |  |   computed: { |  |     displayConfirmButtonText() { |  |       return this.confirmButtonText || t('el.popconfirm.confirmButtonText'); |  |     }, |  |     displayCancelButtonText() { |  |       return this.cancelButtonText || t('el.popconfirm.cancelButtonText'); |  |     } |  |   }, |  |   methods: { |  |     confirm() { |  |       this.visible = false; |  |       this.$emit('confirm'); |  |     }, |  |     cancel() { |  |       this.visible = false; |  |       this.$emit('cancel'); |  |     } |  |   } |  | }; |  | </script> | 
 |