2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
2019-12-14 12:44:35 +00:00
|
|
|
<button
|
2020-05-05 18:40:56 +00:00
|
|
|
:type="type"
|
2020-07-21 14:41:22 +00:00
|
|
|
data-testid="submit_button"
|
2019-12-14 12:44:35 +00:00
|
|
|
:disabled="disabled"
|
|
|
|
:class="computedClass"
|
|
|
|
@click="onClick"
|
|
|
|
>
|
2021-12-01 05:03:18 +00:00
|
|
|
<fluent-icon v-if="!!iconClass" :icon="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: '',
|
|
|
|
},
|
2020-05-05 18:40:56 +00:00
|
|
|
type: {
|
|
|
|
type: String,
|
|
|
|
default: 'submit',
|
|
|
|
},
|
2019-08-25 14:29:28 +00:00
|
|
|
},
|
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>
|