Created
January 27, 2019 09:41
-
-
Save dobromir-hristov/7c5e4c3c1a9fe7766038f1324ad92963 to your computer and use it in GitHub Desktop.
Using the promise awaiting component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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