Materialize: Uncaught TypeError: $(...).material_select is not a function

Created on 1 Feb 2017  路  4Comments  路  Source: Dogfalo/materialize

Uncaught TypeError: $(...).material_select is not a function

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!

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericlormul picture ericlormul  路  3Comments

heshamelmasry77 picture heshamelmasry77  路  3Comments

lpgeiger picture lpgeiger  路  3Comments

artur99 picture artur99  路  3Comments

bradley-varol picture bradley-varol  路  3Comments