2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
|
|
|
<button type="submit" :disabled="disabled" :class="computedClass">
|
2019-08-25 14:29:28 +00:00
|
|
|
<i v-if="!!iconClass" :class="iconClass" class="icon"></i>
|
|
|
|
<span>{{ buttonText }}</span>
|
|
|
|
<spinner v-if="loading" />
|
2019-08-14 09:48:44 +00:00
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Spinner from '../Spinner';
|
|
|
|
|
|
|
|
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
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|