Reasons: 1. IE8 and below versions do not support the Object.defineProperty method, but this is necessary for Vue to implement responsiveness, so judging from the source code of Vue, it cannot support IE8 at all; 2. Vue needs Supports Promise support, IE8 does not support Promsie.
Look at the official website of Vue to see why IE8 is not supported
Vue.js will implement two-way for all For bound data, use Object.defineProperty to convert all these properties into getters/setters. Object.defineProperty is a feature in ES5 that cannot be shimmed, which is why Vue does not support IE8 and lower browsers.
Note here: Object.defineProperty is a method that cannot be implemented through the underlay and is related to the browser itself, so Vue fundamentally cannot support IE8;
Vue does not support IE8 and below because Vue uses ECMAScript 5 features that IE8 cannot emulate. But it supports all browsers that are compatible with ECMAScript 5
Moreover, Vue needs to support Promise support, and IE8 also does not support Promsie.
Extended information:
Object.defineProperty()
This method allows precise addition or modification of the properties of the object. Generally, we add properties to objects by assigning values to create and display them in the property enumeration (for...in or Object.keys method), but the property values added in this way can be changed or deleted. Using Object.defineProperty() allows changing the default settings for these additional details. For example, by default, property values added using Object.defineProperty() are immutable.
Search for "Object.defineProperty" in the vue source code:
You can see that there are 5 matching places, which means there are 5 places in vue "Object.defineProperty()" is used.
The version searched is: Vue.js v1.0.26
Browser support for Object.defineProperty():
Yes It can be seen that the support is IE9 and above.
Related recommendations:
2020 front-end vue interview questions summary (with answers)
vue tutorial Recommendation: The latest 5 vue.js video tutorial selections in 2020
For more programming-related knowledge, please visit: Programming Teaching! !
The above is the detailed content of Why can't vue.js support ie8?. For more information, please follow other related articles on the PHP Chinese website!