一、问题描述:
环境相关:
Node: 15.14.0
Vue: 2.6.11
error in ./src/views/shopping_mall/order.vue?vue&type=template&id=7c1a587c&scoped=true&
Syntax Error: Unexpected token (1:416)
@ ./src/views/shopping_mall/order.vue?vue&type=template&id=7c1a587c&scoped=true& 1:0-434 1:0-434
@ ./src/views/shopping_mall/order.vue
@ ./src/router/router.config.js
@ ./src/router/index.js
@ ./src/main.js
@ multi ./src/main.js
二、原因调查:
编译不支持可选链?.语法,特别是vue tempalte中暂不支持该语法,即使Vue升级至2.7.0+和babel.config.js中配置了“@babel/plugin-proposal-optional-chaining”也一样。