Vue JS render error on IE / Microsoft Edge

ぃ、小莉子 提交于 2021-01-29 09:43:52

问题


The page is loading correctly on every browser except IE 11 and Microsoft Edge. The only error that i can see is "SCRIPT1028: SCRIPT1028: Expected identifier, string or number chunk-vendors.8615b873.js (1407,41419)". The code:

this.form.addEventListener("submit",async e=>{
try{
this.$emit("loading",!0),e.preventDefault();
const{
,error:n
}=await this.$stripe.createToken({...this.card,amount:1e3});

回答1:


Does the error point to the line using { ...obj } object rest/spread properties? The syntax is a part of ECMAScript 2018 which is not supported by Edge Legacy and IE. You could also refer to this thread and this thread which have similar issues.

You need to use Babel to transpile it. Install @babel/plugin-proposal-object-rest-spread by running:

npm install --save-dev @babel/plugin-proposal-object-rest-spread

Then include it as plugin according to the usage.



来源:https://stackoverflow.com/questions/60695060/vue-js-render-error-on-ie-microsoft-edge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!