Vue is not a constructor

前端 未结 2 957
悲&欢浪女
悲&欢浪女 2021-02-12 15:25

I using webpack, after build and run in chrome show this error,I don\'t know how to solve it.

My code is very simple:

<         


        
相关标签:
2条回答
  • 2021-02-12 15:47

    You need to import the runtime only build. This comment in the Github issues explains.

    Put this in your webpack.config.js.

    resolve: {
      alias: {
        vue: 'vue/dist/vue.js'
      }
    }
    
    0 讨论(0)
  • 2021-02-12 15:49

    Vue is the default export from that library so you import like this.

    import Vue from 'vue'
    
    0 讨论(0)
提交回复
热议问题