How to use MaterializeCss with Vue.js?

后端 未结 3 467
感情败类
感情败类 2021-02-02 04:15

I don\'t want to use Vue-Material nor Vuetify.

I want to use Materialize. What I do is:

npm install materialize-css@next

In main.js, w

3条回答
  •  孤城傲影
    2021-02-02 04:22

    Step 1: installation

    npm install materialize-css@next --save
    npm install material-design-icons --save
    

    Step 2: import materialize css in src/main.js

    At src/main.js

    import 'materialize-css/dist/css/materialize.min.css'
    import 'material-design-icons/iconfont/material-icons.css'
    

    Step 3: initialize materialize components

    Add following code in your component(say App.vue):

    import M from 'materialize-css'
    
    export default {
    ...
    mounted () {
        M.AutoInit()
    },
    ...
    

提交回复
热议问题