Home > Article > Web Front-end > Detailed explanation of using Vue for debugging in IE
This time I will bring you a detailed explanation of the use of Vue for debugging in ie. What are the precautions. Here are practical cases, let’s take a look.
Found the problem
A Vue I wrote a few days ago is blank under IE, and f12 displays script1003: expected :
. So there is this article...
Solution process
Baidu and Google said that the last item of json is redundant Commas, such as
{ a: 5, b: 4, // 最后一项不能有逗号 }
are not displayed when searching and correcting all js files, but the situation remains the same. . .
I have no choice but to show my invincible and wise debugging skills: Remove the full text Comments, and then uncomment line by line, and finally locate the bug location: A plug-in for customizing the right-click menu (v- contextmenu) has a problem. . .
Continuing with the previous smart debugging techniques, I finally discovered several bugs. . .
Under this plug-in, the last item of all objects has a comma, which makes it incompatible under IE
{ a: 5, b: 4, // 这个逗号要删除 }
// ie下不支持这种语法 export default { bind() {} } // 必须在外面定义 function bind() {} 然后 export default { bind: bind } // 特别告诫,下面这种语法在ie中也是不支持的 export default { bind }
The most important thing is that this plug-in is in a very hidden place There are two lines of code
if(condition) { someArray.push({ a, b }) } else { anotherArray.push({ a, b }) }
The syntax {a, b} is not supported by IE and must be changed to {a: a, b: b}
I believe I read the case in this article You have mastered the method. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
jquery implements element plane movement
Analysis of listener use cases in Vue.js
The above is the detailed content of Detailed explanation of using Vue for debugging in IE. For more information, please follow other related articles on the PHP Chinese website!