VueButtonSpinner
Simple VUE 2 component to create a button spinner. The perfect solution for your submit buttons!
Features
- Show an css loader into the button to indicate the request status.
- Add a custom html inside the component.
- Pure CSS loaders, no fonts or images have been used.
- Different styles for each state: loading, success, error.
- Available props:
- 'isLoading' (boolean) to show the spinner
- 'status' (String | Boolean) allow 'success' or true and 'error' or false.
- Remember use the .native modifier for the events (docs)
Install
npm install vue-button-spinner
Usage
Example:
[Your .vue component (vue-loader with webpack or use vue-cli projects)]
; name: 'events-form' { return isLoading: false status: '' } components: VueButtonSpinner methods: { thisisLoading = true }
[Your HTML code]
Submit