请教 Laravel 5.3 撸 vue 2.1.4 撸不起来

package.json

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch"
  },
  "devDependencies": {
    "bootstrap-sass": "^3.3.7",
    "font-awesome": "^4.7.0",
    "gulp": "^3.9.1",
    "jquery": "^3.1.0",
    "laravel-elixir": "^6.0.0-14",
    "laravel-elixir-vue-2": "^0.2.0",
    "laravel-elixir-webpack-official": "^1.0.2",
    "lodash": "^4.16.2",
    "metismenu": "^2.6.0",
    "tether": "^1.4.0",
    "vue": "^2.1.4",
    "vue-resource": "^1.0.3"
  },
  "dependencies": {
    "laravel-echo": "^1.0.5",
    "pusher-js": "^3.2.1"
  }
}

gulp 入口 app.js

window.Vue = require('vue');
require('vue-resource');

Vue.http.interceptors.push((request, next) => {
    request.headers['X-CSRF-TOKEN'] = Laravel.csrfToken;

    next();
});

html 页面 body 下面就是这个id

<body>
    <div id="wrapper">

实例化

var Vm = new Vue({
    el : '#wrapper',
});

报错

vue.runtime.common.js?bd92:509 
[Vue warn]: Failed to mount component: template or render function not defined. 
(found in root instance)

请教各位大神, 这是什么情况呀:

《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 3

你尝试将:

window.Vue = require('vue');

改为:

window.Vue = require('vue/dist/vue.js');

vue 2.0 后默认读取的是 vue.common.js 文件。

8年前 评论

@cjjian
在 vue package.json 中确实发现了这个

"license": "MIT",
"main": "dist/vue.runtime.common.js",

能否将这个main 改成

"main": "dist/vue.js"

这样做会不会留什么坑

8年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!