我已经创建了带有laravel集成的vuejs模板。在使用vue-laravel创建项目时,默认情况下laravel-mix版本为2.0,那时我的项目在所有浏览器中都运行良好。但是现在我将laravel-mix的版本从2.0更新到4.0.14。更新时,IE浏览器上应显示空白屏幕。由于我是vue + laravel的新手,因此对此知识不足。我正在尝试通过跟踪许多链接来解决此问题,但没有得到结果。请任何人知道如何在IE上运行vue + laravel项目以及需要进行哪些更改。
IE浏览器控制台的屏幕截图:
这是我的webpack.mix.js文件代码:
//webpack.mix.js
let mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.autoload({
'jquery': ['$', 'window.jQuery', 'jQuery'],
})
mix.js('resources/js/main.js', 'public/js');
这是我在package.json文件中的开发依赖项:
// package.json
"devDependencies": {
"axios": "^0.18",
"babel-preset-stage-2": "^6.24.1",
"bootstrap": "^4.1.3",
"cross-env": "^5.2.0",
"jquery": "^3.3.1",
"laravel-mix": "^4.0.14",
"lodash": "^4.17.11",
"node-sass": "^4.11.0",
"popper.js": "^1.14.6",
"sass-loader": "^7.1.0",
"vue": "^2.5.19",
"vue-template-compiler": "^2.5.22"
}
.babelrc文件代码:
//.babelrc
{
"plugins": ["syntax-dynamic-import"]
}
如果有人需要更多信息,请告诉我。谢谢!
答案 0 :(得分:0)
对于IE,您还需要安装并包括polyfill。
npm install --save @babel/polyfill