使用vue-cli, ie白屏问题
安装插件babel-polyfillbabel-plugin-transform-es2015-arrow-functions(转箭头函数)并进行配置在webpack.base.config.js中修改为:context: path.resolve(__dirname, '../'),entry: {app:['babel-polyfill','./src/main.js']},...
·
安装插件
babel-polyfill
babel-plugin-transform-es2015-arrow-functions(转箭头函数)
并进行配置
在webpack.base.config.js中修改为:
context:
path.
resolve(
__dirname,
'../'),
entry: {
app:[
'babel-polyfill',
'./src/main.js']
},
在main.js中最顶部增加:
import
'babel-polyfill'
在.babelrc文件中修改为:
{
"presets": [
[
"env", {
"modules":
false,
"targets": {
"browsers": [
"> 1%",
"last 2 versions",
"not ie <= 8"]
}
}],
"stage-2"
],
"plugins": [
"transform-vue-jsx",
"transform-runtime",
"transform-es2015-arrow-functions"]
}
更多推荐
已为社区贡献3条内容
所有评论(0)