https://github.com/STUkh/vue-promise-btn
Vue.js plugin that handles buttons async lock state. Demo: https://stukh.github.io/vue-promise-btn/
https://github.com/STUkh/vue-promise-btn
promise-btn spinner vue vue-promise-btn
Last synced: 7 months ago
JSON representation
Vue.js plugin that handles buttons async lock state. Demo: https://stukh.github.io/vue-promise-btn/
- Host: GitHub
- URL: https://github.com/STUkh/vue-promise-btn
- Owner: STUkh
- License: mit
- Created: 2018-03-16T14:29:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-29T10:38:25.000Z (almost 3 years ago)
- Last Synced: 2025-04-22T01:19:45.664Z (8 months ago)
- Topics: promise-btn, spinner, vue, vue-promise-btn
- Language: JavaScript
- Homepage:
- Size: 3.93 MB
- Stars: 172
- Watchers: 6
- Forks: 13
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-vue-zh - Vue - 承诺 - BTN - 用于异步按钮 (或任何其他标签) 的小巧而强大的工具,可以锁定花哨的内置微调器 (UI组件 / 装载机)
- awesome-vue - vue-promise-btn - Vue.js plugin that handles buttons async lock state. Demo: https://stukh.github.io/vue-promise-btn/ ` 📝 5 months ago` (UI Components [🔝](#readme))
- awesome-vue - vue-promise-btn - Tiny and powerful tool for asynchronous buttons(or any other tag) lock with fancy built-in spinner (Components & Libraries / UI Components)
- awesome-vue - vue-promise-btn ★117 - Tiny and powerful tool for asynchronous buttons(or any other tag) lock with fancy built-in spinner (UI Components / Loader)
- awesome-vue - vue-promise-btn - Tiny and powerful tool for asynchronous buttons(or any other tag) lock with fancy built-in spinner (UI Components / Loader)
README
# vue-promise-btn
[](https://www.npmjs.com/package/vue-promise-btn)
[](https://www.npmjs.com/package/vue-promise-btn)
## Example and Documentation
https://STUkh.github.io/vue-promise-btn/
## Features
- Easy-to-use API
- Flexible Usage
- Works with any tag and even forms
- In Extended Mode - compatible with 3rd party components
- Packaged with optional built-in spinner
- Only 1.5KB minified and gzipped
- ESM, CommonJS, UMD versions
### Installation
```
npm install --save vue-promise-btn
```
#### Quick Start:
- Import and "handshake" plugin with vue
```javascript
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, {})
```
- Simple usage:
``` Get Data ```
- Extended usage: ``` Get Data ```
#### If you face any issue with simple mode, just try out extended, it's more reliable way.
## Change log
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Important Notice
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);"`
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.
## Credits
- [Alex Stepchenkov](https://github.com/STUkh)
- [All Contributors](https://github.com/STUkh/vue-promise-btn/graphs/contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
© [STUkh](https://github.com/STUkh)