-
-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to clear VsSelect options #421
Comments
Hi, If you have
I hope this will work. |
I think she wanted that built in the select component, similar to this, but unfortunately there isn't one yet. |
I have a
When the popup is loaded for the first time, the Then the user selects an option, and saves the item, and then I close the popup. But the next time the popup is loaded, it shows the previous selection the user made in the What I would like is to clear just the selection in the Thank you. |
I'm sorry but I don't think I understand the problem here. 1.Did you try to set |
I do not really understand the problem, sorry you could help me to solve it, thank you very much for the contribution |
What I need is to unselect the previuos selection. I think the solution is not clearing the array. The This is a "create" situation. |
Yes, that's right. |
@ccalvarez You could create a jsfiddle of the whole context and what does not work, to help you |
@ccalvarez this is not really a <vs-select v-model="product.category_id" label="Categories">
<vs-select-item :key="0" :value="''" :disabled="true" v-show="false"/>
<vs-select-item
:key="item.id"
:value="item.id"
:text="item.name"
v-for="item in categories"
/>
</vs-select> Look at the first I don't use popups, but another component. whenever I "clear" my model with this: clearForm() {
Object.keys(this.product).forEach(el => this.product[el] = '')
} the select options gets blank again. then is up to you to validate and all that stuff. beware that the |
One easy solution for dynamic list |
Thanks to @rccursach hint, I slightly changed its code to fit my needs as follow:
Few things to keep in mind: I used I removed Really thanks to @rccursach for pointing me to the right direction. |
Hi.
How do I clear (unselect all options) of a vs-select?
Thank you.
The text was updated successfully, but these errors were encountered: