advent22/ui/src/components/bulma/Button.vue

42 lines
836 B
Vue
Raw Normal View History

2023-09-07 15:43:05 +00:00
<template>
<button class="button">
2023-09-14 13:54:23 +00:00
<slot v-if="text === undefined" name="default">
2023-09-12 22:35:57 +00:00
<font-awesome-icon :icon="icon" :beat-fade="busy" />
2023-09-14 13:54:23 +00:00
</slot>
<template v-else>
<span v-if="icon !== undefined" class="icon">
<slot name="default">
<font-awesome-icon :icon="icon" :beat-fade="busy" />
</slot>
</span>
<span>{{ text }}</span>
</template>
2023-09-07 15:43:05 +00:00
</button>
</template>
<script lang="ts">
import { Options, Vue } from "vue-class-component";
@Options({
props: {
2023-09-07 16:51:19 +00:00
icon: {
type: String,
required: false,
},
2023-09-09 22:43:11 +00:00
text: {
type: String,
2023-09-14 13:54:23 +00:00
required: false,
2023-09-09 22:43:11 +00:00
},
2023-09-12 22:35:57 +00:00
busy: {
type: Boolean,
default: false,
},
2023-09-07 15:43:05 +00:00
},
})
export default class extends Vue {
2023-09-07 16:51:19 +00:00
public icon?: string;
2023-09-14 13:54:23 +00:00
public text?: string;
2023-09-12 22:35:57 +00:00
public busy!: boolean;
2023-09-07 15:43:05 +00:00
}
</script>