diff --git a/src/runtime/components/BitinflowButton.vue b/src/runtime/components/BitinflowButton.vue index 359a439..ae09b67 100644 --- a/src/runtime/components/BitinflowButton.vue +++ b/src/runtime/components/BitinflowButton.vue @@ -4,7 +4,10 @@ :class="computedClass" @click="click" > - + + @@ -17,6 +20,10 @@ export default { type: String, default: 'md' }, + loading: { + type: Boolean, + default: false + }, color: { type: String, default: 'base' @@ -35,12 +42,13 @@ export default { computed: { computedClass: function () { - return `button-text-${this.size} ${this.color}-${this.variant}` + return `button-text-${this.size} ${this.color}-${this.variant} ${this.disabled ? 'disabled' : ''} ${this.loading ? 'loading' : ''}` }, }, methods: { click() { + if (this.disabled || this.loading) return; this.$emit('click'); } } @@ -48,51 +56,72 @@ export default {