Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/Btn.vue
<template> | <template> | ||||
<button class="btn" :type="type" @click="$emit('click', $event)"> | <button class="btn" :type="type" @click="$emit('click', $event)" :disabled="isLoading"> | ||||
<svg-icon v-if="icon" :icon="icon"></svg-icon> <slot></slot> | <span v-if="isLoading" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> | ||||
<svg-icon v-else-if="icon" :icon="icon"></svg-icon> <slot></slot> | |||||
</button> | </button> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
export default { | export default { | ||||
props: { | props: { | ||||
type: { type: String, default: 'button' }, | type: { type: String, default: 'button' }, | ||||
icon: { type: [ Array, String ], default: '' }, | icon: { type: [ Array, String ], default: '' }, | ||||
isLoading: { type: Boolean, default: false } | |||||
} | } | ||||
} | } | ||||
</script> | </script> |