-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Multiple dynamic ids in v-b-toggle #4834
Comments
v-b-toggle will work with multiple ID's passed via directive modifiers, but only a single ID can be passed as the directive value (part between the quotes): https://bootstrap-vue.org/docs/components/collapse#trigger-multiple-collapse-elements It sounds like you may need to use the v-model support (https://bootstrap-vue.org/docs/components/collapse#v-model-support) to trigger the collapse state for all collapses when toggling all. |
Alternatively to the v-model solution you could create a method which takes an array of id's as a parameter and use the option to emit on root, by looping through the passed in ID's and emitting for each of them.
|
Thanks for the answers 🙂 . Both works. I knew about |
@Frantab we will be "tweaking" how b-b-toggle works, and hopefully allow users to pass an array of IDs to toggle (via the v-b-toggle directive value). |
@Frantab BootstrapVue 2.14.0 has been released, and supports multiple target IDs passed as an array to the v-b-toggle directive value. See the updated docs at https://bootstrap-vue.org/docs/directives/toggle |
@tmorehouse Nice! 🙌 |
I was experiencing a bug only on production with "regular" way: So the @Hiws solution using "this.$root.$emit" solved my issue, thank you a lot |
@jonaswebdev was the issue with the latest version (2.14.0)? |
@tmorehouse no, my current version is "bootstrap-vue": "^2.0.0-rc.15", sorry. I will update "bootstrap-vue" version and rollback my code without v-model approach, then back to you. Thank you |
I updated from 2.13.0 to 2.14.0 and all of the project dropdowns broke. They look like this
|
@nachogarcia there will be a fix in |
@tmorehouse I've tested it with v2.15.0 and it's still broken |
@nachogarcia could you create a reproduction jsfiddle/codepen/codesandbox? you can export to jsfiddle/codesanbox/codepen from the docs playground https://bootstrap-vue.org/play |
I just tested in the playground, and it works fine for me: https://codesandbox.io/s/little-pond-hnfci |
Uhm, you're right. I can't reproduce it in the sandbox either. Will look deeper in the codebase to see what issues v14 introduced for me. Maybe there is something related to updates, styles, or something else. |
In case it helps, I'm using bootstrap-vue/nuxt, and not including css because I import it later via SCSS. |
is there a way we can pass dynamic value in the id property of the b-collapse component |
Use |
Try this
|
Hey :),
I cannot find how to add multiple dynamically created ids into directive
v-b-toggle
. I've found a solution just for a single dynamic id.I've tried this, but none of this works:
Is there any way how to do it and set more than one modifier dynamically?
The whole problem in short:
The text was updated successfully, but these errors were encountered: