1.安装

npm install -D vue-loader vue-template-compiler

2.配置webpack.config.js

const VueLoaderPlugin = require('vue-loader/lib/plugin')

module.exports = {
  module: {
    rules: [
      // ... other rules
      {
        test: /\.vue$/,
        loader: 'vue-loader'
      }
    ]
  },
  plugins: [
    // make sure to include the plugin!
    new VueLoaderPlugin()
  ]
}

3.main.js文件

import Vue from 'vue'
import App from './App.vue'

var vm = new Vue({
el: '#app',
render:f=>f(App),
// template:'<App/>',
// components:{
//     App
// }
})

 

posted on 2019-10-21 18:23  宅到深夜  阅读(326)  评论(0)    收藏  举报