-
Notifications
You must be signed in to change notification settings - Fork 1
/
InfoDialog.vue
57 lines (51 loc) · 1.08 KB
/
InfoDialog.vue
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
<script>
import StandartDialog from './StandartDialog';
export default {
props: ['type', 'strict', 'yesText'],
components: {
StandartDialog,
},
computed: {
style() {
const btn = {
default: '',
success: 'is-success',
warning: 'is-warning',
danger: 'is-danger',
info: 'is-info',
};
return this.type ? btn[this.type] : 'is-primary';
},
yes() {
return this.yesText || 'ХОРОШО';
},
},
methods: {
confirm() {
this.$emit('confirm');
if (!this.strict) {
this.$emit('close');
}
},
},
};
</script>
<template>
<StandartDialog @close="$emit('close')">
<template #title>
<slot name="title"></slot>
</template>
<template #default>
<slot></slot>
</template>
<template #footer>
<button class="button" :class="style" @click="confirm">
<slot name="yesIcon"></slot>
<span>{{yes}}</span>
</button>
</template>
<template #extend>
<slot name="extend"></slot>
</template>
</StandartDialog>
</template>