I'm trying to build a custom directive for Bootstrap that makes a <select>
input into a "selectpicker" from Bootstrap selectpicker
Also I would like this directive to use the default options
functionality of VueJS for filling the options on a <select>
So the html would be something like this:
<select v-selectpicker="myValue" options="myOptions"></select>
Now I can create the directive perfectly and use the bind
method to call the selectpicker()
method on the element. The problem seems to be the fact that the options are set after the call to selectpicker()
.
So somehow I need to either wait until the options are set, or I have to do another call to selectpicker(refresh)
when the options are set.
Does anyone know if this is possible?