我已经使用vue-cli3在vuejs中创建了一个项目。它在chrome浏览器上工作正常,但在IE-11版本中,空白屏幕在控制台中显示以下错误,如此链接所述:https://drive.google.com/file/d/1QaNwK1ekI2BwFsFyjvgbSsvwHBCmlcAD/view?usp=drivesdk在单击控制台错误时,我已经在上面的屏幕截图中指出,它打开一个屏幕,显示在给定的链接https://drive.google.com/file/d/1_QXVjcw3cmqeC70LfNyLcr__rnXVIZIh/view?usp=drivesdk中,错误在mini-toastr包中:这是我的babel.config.js文件代码:
module.exports = {
presets: [
['@vue/app', {
polyfills: [
'es6.promise',
'es6.symbol'
]
}]
]
}和.browserslistrc文件代码:
> 1%
last 2 versions
not ie <= 8我没有达到我正在犯的错误的地步。我是不是遗漏了什么?如果有人需要更多的信息,请让我知道。谢谢!
发布于 2018-08-31 20:16:14
我最终得到了上述问题的解决方案。要在IE-11版本上运行项目,只需执行以下两个步骤:
使用命令"npm install --save babel-polyfill".
注意:如果你在最后导入babel-polyfill,它就不能工作。
import 'babel-polyfill'
import Vue from 'vue'
import Vuetify from 'vuetify'
import router from './router'
// include script file
import './lib/DemoScript'
// include all css files
import './lib/DemoCss'
Vue.use(Vuetify)
new Vue({
store,
router,
render: h => h(App),
components: { App }
}).$mount('#app')发布于 2019-02-08 19:44:39
另一种解决方案:使用vue-cli-3的强大功能来利用浏览器支持:https://cli.vuejs.org/guide/browser-compatibility.html#modern-mode
在构建时只有一个选项,一旦选择了要支持的浏览器列表,就完成了:-)
这应该可以很好地构建一个应用程序。
https://stackoverflow.com/questions/52056358
复制相似问题