Topic: Multiple MDBSelect Components
bernspe priority asked 3 months ago
Expected behavior Multiple dynamically created MDBSelect components should be able to save v-model:selected inside a common ref.
Actual behavior It seems that multiple MDBSelect components' v-model:selected cannot be addressed with Array or Record like structure as const selArray = ref(new Array(5).fill(0)) as the mutation will always affect the complete array, so changing one MDBSelect component to 3 will change the whole Array to [3,3,3,3,3] Is there any way to harbor multiple MDBSelect v-model:selected in one component and declaring them dynamically? Resources (screenshots, code snippets etc.)
Bartosz Cylwik staff answered 3 months ago
Hi! Unfortunately managing select components under one single ref / reactive value is not possible at this moment.
We will discuss this issue in our team.
bernspe priority commented 3 months ago
Hi, in the meanwhile I solved it by wrapping the MDBSelect and having the wrapped component deal with the values. Best, Peter.
Bartosz Cylwik staff commented 3 months ago
Thanks for sharing your workaround!
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Vue
- MDB Version: MDB5 5.0.0
- Device: Desktop
- Browser: Chrome
- OS: MacOSX
- Provided sample code: No
- Provided link: No