Skip to content

Instantly share code, notes, and snippets.

@dobromir-hristov
Created January 27, 2019 09:34
Show Gist options
  • Save dobromir-hristov/898c9a0ffa59fbb8a86a2ea3c6d621a0 to your computer and use it in GitHub Desktop.
Save dobromir-hristov/898c9a0ffa59fbb8a86a2ea3c6d621a0 to your computer and use it in GitHub Desktop.
Template for the self promise awaiting button
<button
v-on="listeners"
:class="computedClasses"
:disabled="loadingState"
class="button is-primary"
>
<slot name="loading" v-if="loadingState">Loading...</slot>
<slot name="success" v-else-if="isSuccess">Sucess!</slot>
<slot name="error" v-else-if="hasError">Errored</slot>
<slot v-else />
</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment