Skip to content

Instantly share code, notes, and snippets.

@Paulsky
Created April 19, 2024 11:01
Show Gist options
  • Save Paulsky/4bf59a4d9fe2a96aca6f202c61f543b6 to your computer and use it in GitHub Desktop.
Save Paulsky/4bf59a4d9fe2a96aca6f202c61f543b6 to your computer and use it in GitHub Desktop.
Old LoadingButton component used in Laravel Nova before removal: https://github.com/laravel/nova-issues/discussions/6025
<template>
<button ref="button" v-bind="{ ...$attrs }" v-on="$listeners">
<span :class="{ hidden: processing || loading }">
<slot />
</span>
<span v-if="processing || loading">
<loader width="32" />
</span>
</button>
</template>
<script>
export default {
props: {
loading: {
type: Boolean,
default: false,
},
processing: {
type: Boolean,
default: false,
},
},
methods: {
focus() {
this.$refs.button.focus()
},
},
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment