Skip to content

Instantly share code, notes, and snippets.

@shealan
Created May 30, 2019 01:49
Show Gist options
  • Save shealan/67660f0e7ec73e33e71cc95225cc2daf to your computer and use it in GitHub Desktop.
Save shealan/67660f0e7ec73e33e71cc95225cc2daf to your computer and use it in GitHub Desktop.
<template>
<button :disabled="loading" :type="type" :class="{ 'opacity-50': loading }" class="transition text-white py-2 px-3 text-sm font-semibold rounded focus:outline-none"><fa v-if="icon" :icon="icon" class="mr-2"/>{{ text }} <fa v-if="loading" class="ml-2" icon="sync-alt" spin/></button>
</template>
<script>
export default {
props: {
type: {
type: String,
default: 'button'
},
text: {
type: String,
default: 'Submit'
},
loading: {
type: Boolean,
default: false
},
icon: {
type: String,
default: ''
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment