Closed qiaolin-pan closed 7 years ago
我建议升级vue到2.1.6版本,并且升级相应的loader
"vue": "^2.1.6",
"vue-loader": "^10.0.2",
"vue-template-compiler": "^2.1.6",
我自己在这个配置下测试没出现问题,可以试下,还有问题的话,请继续提出
贴一下我测试的 package.json
吧
{
"name": "test",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "Chenz <chenz8606@gmail.com>",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"build": "node build/build.js"
},
"dependencies": {
"vue": "^2.1.6",
"vue-blu": "^0.1.7",
"vue-router": "^2.1.1"
},
"devDependencies": {
"autoprefixer": "^6.4.0",
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.0.0",
"babel-register": "^6.0.0",
"chalk": "^1.1.3",
"connect-history-api-fallback": "^1.1.0",
"css-loader": "^0.25.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"friendly-errors-webpack-plugin": "^1.1.2",
"function-bind": "^1.0.2",
"html-webpack-plugin": "^2.8.1",
"http-proxy-middleware": "^0.17.2",
"json-loader": "^0.5.4",
"node-sass": "^4.3.0",
"opn": "^4.0.2",
"ora": "^0.3.0",
"sass-loader": "^4.1.1",
"semver": "^5.3.0",
"shelljs": "^0.7.4",
"url-loader": "^0.5.7",
"vue-loader": "^10.0.2",
"vue-style-loader": "^1.0.0",
"vue-template-compiler": "^2.1.6",
"webpack": "^1.13.2",
"webpack-dev-middleware": "^1.8.3",
"webpack-hot-middleware": "^2.12.2",
"webpack-merge": "^0.14.1"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
}
}
是不是全需要的? 我现在加上了 vue-template-compiler 和 vue-loader,也不行
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"gulp": "^3.9.1",
"jquery": "^3.1.0",
"laravel-elixir": "^6.0.0-9",
"laravel-elixir-vue-2": "^0.2.0",
"laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.16.2"
},
"dependencies": {
"vue": "^2.1.10",
"vue-blu": "^0.1.7",
"vue-chartjs": "^2.3.2",
"vue-loader": "^10.0.2",
"vue-resource": "^1.0.3",
"vue-router": "^2.1.1",
"vue-template-compiler": "^2.1.10",
"vuedraggable": "^2.7.0-rc0"
}
}
对了,我用的是php的laravel框架。使用gulp构建的,不是webpack。
你先试一下vue@2.1.6, 2.1.10版本我估计可能会有问题,这是个新版本,我还没测过。gulp构建的稍后我会测一下
vue@2.1.6也不行,可能需要用webpack吧,laravel自带的有问题
我看了下laravel,应该也可以正常跑起来,我会搭建一下,成功了会把工程传到一个仓库上
我测试了下laravel,出现undefined的原因是因为laravel自带的laravel-elixir-vue-2(@0.2.0)版本有点低了,将它升级至0.3.0,同时将vue-blu升级至0.1.8。问题会得到解决。我贴一下package.json
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"gulp": "^3.9.1",
"jquery": "^3.1.0",
"laravel-elixir": "^6.0.0-9",
"laravel-elixir-vue-2": "^0.3.0",
"laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.16.2",
"vue": "^2.1.6",
"vue-blu": "^0.1.8",
"vue-resource": "^1.0.3"
}
}
测试了一下,vue@2.1.10 也是可以的,再次感谢一下
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"gulp": "^3.9.1",
"jquery": "^3.1.0",
"laravel-elixir": "^6.0.0-15",
"laravel-elixir-vue-2": "^0.3.0",
"laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.16.2",
"vue": "^2.1.10",
"vue-blu": "^0.1.8",
"vue-router": "^2.1.1",
"vue-resource": "^1.0.3"
}
}
系统:macOs 浏览器:chrome 其他如下:
运行结果如下,全是undefined
请问到底是哪里的问题呢?