https://STUkh.github.io/vue-promise-btn/
npm install --save vue-promise-btn
import Vue from 'vue'
import VuePromiseBtn from 'vue-promise-btn'
// not required. Styles for built-in spinner
import 'vue-promise-btn/dist/vue-promise-btn.css'
Vue.use(VuePromiseBtn) // or with global options Vue.use(VuePromiseBtn, {})
<button v-promise-btn @click="getData">Get Data</button>
<button v-promise-btn={ promise: dataPromise } @click="getData('param')">Get Data</button>
Please see CHANGELOG for more information what has changed recently.
Always return Promise from expression. Especially in simple mode.
Don't use semicolon in event expressions. It may break promise return in template-compiler:
Good: @click="handler($event)"
Bad: @click="handler($event);"
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
The MIT License (MIT). Please see License File for more information.