Home > Web Front-end > JS Tutorial > body text

Detailed explanation of using Vue for debugging in IE

php中世界最好的语言
Release: 2018-05-14 14:10:14
Original
2673 people have browsed it

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, // 最后一项不能有逗号
}
Copy after login

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, // 这个逗号要删除
}
Copy after login
// ie下不支持这种语法
export default {
 bind() {}
}
// 必须在外面定义 function bind() {} 然后
export default {
 bind: bind
}
// 特别告诫,下面这种语法在ie中也是不支持的
export default {
 bind
}
Copy after login

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 })
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template