2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
2019-12-14 12:44:35 +00:00
|
|
|
<button
|
|
|
|
type="submit"
|
|
|
|
:disabled="disabled"
|
|
|
|
:class="computedClass"
|
|
|
|
@click="onClick"
|
|
|
|
>
|
2019-12-16 12:53:14 +00:00
|
|
|
<i v-if="!!iconClass" :class="iconClass" class="icon" />
|
2019-08-25 14:29:28 +00:00
|
|
|
<span>{{ buttonText }}</span>
|
|
|
|
<spinner v-if="loading" />
|
2019-08-14 09:48:44 +00:00
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-01-09 07:36:40 +00:00
|
|
|
import Spinner from 'shared/components/Spinner';
|
2019-08-14 09:48:44 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Spinner,
|
|
|
|
},
|
2019-08-25 14:29:28 +00:00
|
|
|
props: {
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
buttonText: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
buttonClass: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
iconClass: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
computed: {
|
|
|
|
computedClass() {
|
2019-08-25 14:29:28 +00:00
|
|
|
return `button nice ${this.buttonClass || ' '}`;
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
},
|
2019-12-14 12:44:35 +00:00
|
|
|
methods: {
|
|
|
|
onClick() {
|
|
|
|
this.$emit('click');
|
|
|
|
},
|
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
};
|
|
|
|
</script>
|