Home  >  Article  >  Web Front-end  >  Summary of debugging methods for blank pages in Vue under ie10

Summary of debugging methods for blank pages in Vue under ie10

php中世界最好的语言
php中世界最好的语言Original
2018-06-01 11:50:301749browse

This time I will bring you a summary of the debugging method of Vue's blank page under ie10. What are the precautions for debugging Vue's blank page under ie10? The following is a practical case, 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}

A whole morning is wasted like this Okay, do you think I want to spray this plug-in? I want to say, whoever uses ie is a dog

The above is the detailed content of Summary of debugging methods for blank pages in Vue under ie10. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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