forked from openWB/openwb-ui-settings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpenwbBaseButtonInput2.vue
54 lines (53 loc) · 1.02 KB
/
OpenwbBaseButtonInput2.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
<template>
<openwb-base-setting-element>
<template #title>{{ title }}</template>
<template #help>
<slot name="help"></slot>
</template>
<template #default>
<openwb-base-click-button
:class="(disabled ? 'btn-outline-' : 'btn-') + subtype"
:disabled="disabled"
v-bind="$attrs"
@buttonClicked.stop="handleClick"
>
{{ buttonText }}
</openwb-base-click-button>
</template>
</openwb-base-setting-element>
</template>
<script>
export default {
name: "OpenwbButtonInput2",
inheritAttrs: false,
props: {
title: String,
buttonText: String,
disabled: { type: Boolean, default: false },
subtype: {
type: String,
validator: function (value) {
return (
[
"info",
"success",
"warning",
"danger",
"primary",
"secondary",
"light",
"dark",
].indexOf(value) !== -1
);
},
default: "secondary",
},
},
emits: ["buttonClicked"],
methods: {
handleClick(event) {
this.$emit("buttonClicked", event);
},
},
};
</script>