Recently I've tried Materialize with Vue2 and Meteor. However, I got a problem where i can't initialize select
$('select').material_select()
this is my code
<div class="input-field">
<select>
<option value="test">Test</option>
</select>
<label for="">Materialize Select</label>
</div>
-JS
export default {
mounted(){
$('select').material_select();
}
}
thanks in advance!
You have not included Materialize correctly in the project. Also please ask support questions on Stack Overflow.
Any solution for this?
@tahnik the function is definitely there so you might have not included Materialize the right way.
https://github.com/Dogfalo/materialize/blob/master/js/forms.js#L477
Did you include the scripts at the bottom of the body after all actual markup?
There seems to have been three different ways to do this based on the version of materialize you have installed.
I had been using 1.0.0.alpha.2 in which
$('select').select();
worked.
I have since moved to the latest release 1.0.0 in which
$('select').formSelect();
works
Check your version and then the appropriate method for calling it.