pc项目在其他浏览器包括edge都正常显示,但在IE浏览器报语法错误,页面的点击事件都无正常使用。
上网搜索资料得知,可能是因为插件中使用了ES6的语法,导致IE无法解析,阻塞了页面逻辑的运行。
最后的解决方案:(此项目采用的是vue的nuxt)
修改nuxt.config,增加:
build: {
transpile: [
'vue-persist' // 出错插件的名称
],
}
参考地址:https://blog.csdn.net/haochangdi123/article/details/111573941
nuxt API的transpile 参考地址: https://zh.nuxtjs.org/docs/2.x/configuration-glossary/configuration-build/#transpile
vue-persist插件的参考地址: https://www.npmjs.com/package/vuex-persist