Skip to content

Instantly share code, notes, and snippets.

@dobromir-hristov
Created January 27, 2019 09:41
Show Gist options
  • Save dobromir-hristov/7c5e4c3c1a9fe7766038f1324ad92963 to your computer and use it in GitHub Desktop.
Save dobromir-hristov/7c5e4c3c1a9fe7766038f1324ad92963 to your computer and use it in GitHub Desktop.
Using the promise awaiting component
<!-- Standard usage -->
<VButton @click.prevent="clickReturningPromise">Click me</VButton>
<!-- Overriding the loading state -->
<VButton
:loading="loading"
@click="clickWithoutPromise"
>
My loading state is passed as a prop
</VButton>
<!-- Passing custom content for each state -->
<VButton @click="clickReturningPromise">
I have slots!
<span slot="success">Awesome! Data has been fetched</span>
<span slot="error">Oops... Something went wrong there...</span>
</VButton>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment