Vue使用编译器随附的内部版本

时间:2019-10-21 22:41:50

标签: javascript vue.js webpack

我收到一条Vue警告,阻止我的页面加载:

ps:我没有使用rsocket-transport-netty,我正在使用build

yarn serve

我知道这是因为Vue的默认模式,我尝试重写webpack,但是它仍然无法正常工作。

这是我的[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build. (found in <Root>)

webpack.config.js

还有我的const path = require('path'); module.exports = { entry: './resources/js/app.js', output: { filename: './public/javascripts/bundle.js', }, resolve: { alias: { vue: 'vue/dist/vue.js' }, }, module: { rules: [ { test: /\.vue$/, loader: 'vue-loader' } ] } }; 配置(我相信这是路由器问题)

main.js

我在做什么错了?

编辑:

解决了我的警告问题,现在我没有收到错误消息,并且没有组件正在加载

import Vue from 'vue'
import VueRouter from 'vue-router'
import VueMaterial from 'vue-material'

// **
// * Components
import Login from './routes/Login';

Vue.config.productionTip = false
Vue.use(VueRouter);
Vue.use(VueMaterial);

const router = new VueRouter({
  mode: 'hash',
  routes: [
    {path: '/', name: 'login', component: Login},
  ]
})

new Vue({
  router
}).$mount('#app')

组件:

module.exports = {
    runtimeCompiler: true
}

0 个答案:

没有答案