How to understand the debug of the blank page of Vue under ie10
How to understand the debug of Vue in the blank page under ie10? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Solution process
Baidu, google, it is said that the last item of json has an extra comma, for example
{a: 5, b: 4, / / the last item cannot have a comma}
Retrieval and correction of all js files are not listed, but the situation remains the same.
There is no way to show the invincible wise debug skills: comment out the full text, remove the comments line by line, and finally locate the bug location: a custom right-click menu plug-in (v-contextmenu) has a problem.
Continue the previous wise debug skills, and finally found that several bug.
Under this plug-in, the last item of all objects has a comma, resulting in incompatibility under ie
{a: 5, b: 4, / / this comma is to be deleted}
The export default syntax of the plug-in is not compatible with ie (see this article: https://www.jb51.net/article/108418.htm for more information on the use of export default)
/ / this syntax export default {bind () {}} / / must be defined outside function bind () {} and then export default {bind: bind} / / Special warning. The following syntax is also not supported in ie export default {bind}.
Most importantly, the plug-in has two lines of code in a very hidden place.
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}.
The whole morning has been wasted. You think I'm going to spray this plug-in? I mean, who uses ie and who's a dog?
This is the answer to the question about how to understand the debug of Vue in the blank page under ie10. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.