2020-08-22 18:35:07 +00:00
|
|
|
<template>
|
|
|
|
<button :type="type" class="button nice" :class="variant" @click="onClick">
|
2021-12-01 05:03:18 +00:00
|
|
|
<fluent-icon
|
2020-08-22 18:35:07 +00:00
|
|
|
v-if="!isLoading && icon"
|
|
|
|
class="icon"
|
2021-12-01 05:03:18 +00:00
|
|
|
:class="buttonIconClass"
|
|
|
|
:icon="icon"
|
2020-08-22 18:35:07 +00:00
|
|
|
/>
|
|
|
|
<spinner v-if="isLoading" />
|
|
|
|
<slot></slot>
|
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
isLoading: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
icon: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
buttonIconClass: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
type: {
|
|
|
|
type: String,
|
|
|
|
default: 'button',
|
|
|
|
},
|
|
|
|
variant: {
|
|
|
|
type: String,
|
|
|
|
default: 'primary',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onClick(e) {
|
|
|
|
this.$emit('click', e);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|