stukh / vue-promise-btn Goto Github PK
View Code? Open in Web Editor NEWVue.js plugin that handles buttons async lock state. Demo: https://stukh.github.io/vue-promise-btn/
License: MIT License
Vue.js plugin that handles buttons async lock state. Demo: https://stukh.github.io/vue-promise-btn/
License: MIT License
Does this library supports being uses with Vuetify <v-btn />
?
For example
<v-btn vue-promise-btn @click.stop="onAuthenticate" block color='primary'>Sign In</v-btn>
I could not get this to work, I believe, to make v-btn as loading state simply specify loading as true as follows
<v-btn loading />
Running on Vue 2.6, vue-promise-btn errors out on instantiating:
[Vue warn]: Error in directive promise-btn bind hook: "Error: Please, provide proper handler/action for promise-btn"
I try to pass a parameter for the function called when clicking the button, but I figured out that this doesn't work.
Is it there any workaround in order to pass parameters to the function and still have the spinner working?
<button class="btn btn-default" @click="test(param1)" v-promise-btn>Save</button>
Thank you
I'm not sure if it's a bug or a feature but it doesn't seem to work correctly when using the v-promise-btn
directive inside a <b-btn>
component, for example: https://jsfiddle.net/kb728u3j/
<b-btn v-promise-btn @click="submit">Create</b-btn>
Currently, nothing happen (the spinner is not displayed - the hidden
class isn't removed when loading). The same code works as expected with a regular <button>
.
Versions:
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
The promise reference in extended mode does not accept an array expression.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
https://codesandbox.io/s/2v22232nx0
What is the expected behavior?
I would like to have an array reference in the promise reference.
Which versions of Vue and VuePromiseBtn, and which browser / OS are affected by this issue?
I am using Vue 2.6.8, vue-promise-btn 2.0.2.
The code sandbox has 2.6.10, doesn't make a difference.
On Windows 7, using Chrome 72.0.3626.121
I am opening this because it is still an issue like reported in #2 - however it looks like there is no activity on that issue.
vue-promise-btn does not like function arguments at all, I want to be able to pass my vee-validate scope directly into the method rather than having to define an additional data property.
Here is a link to the issue reproduced in CodeSandbox, I also included your suggestion from issue #2 which does not work either.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.