53
rated 0 times
[
55]
[
2]
/ answers: 1 / hits: 35767
/ 8 Years ago, mon, january 25, 2016, 12:00:00
I've got some custom components in Vue.js. In one of the components I have is a select list that I want to render as a Chosen select box. I use this with a jQuery function $(select).chosen()
.
<template v-for=upload in uploads>
<new-upload-container :index=$index :upload=upload v-if=isNewUpload></new-upload-container>
<existing-upload-container :index=$index :upload=upload v-if=isExistingUpload></existing-upload-container>
</template>
After I add data to the uploads
bound array in the Vue instance, the view updates with an instance of the component. Unfortunately when I try to instantiate Chosen
on the select field, it doesn't work.
I'm not sure if it takes a short time after I add an item to the uploads
bound array that the DOM actually updates.
<template id=existing-upload-container>
<select name=beats[@{{ index }}][existing_beat] class=existing-beats>
<option selected=selected value=>-- Select a linked beat --</option>
@foreach ($beats as $beat)
<option value={{$beat->id}}>{{$beat->name}}</option>
@endforeach
</select>
</template>
Is there an event that is triggered after a component has been fully rendered?
More From » vue.js