How is vue compatible with IE8?
PHP中文网
PHP中文网 2017-05-19 10:30:50
0
4
1142

Please give me some advice, is there any way for vue to be compatible with ie8?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all (4)
phpcn_u1582

The data changes of

vue.js are dependent onObject.defineProperty().
So, we need to break through this point mentioned in the official documents first, for now. Without patches, compatibility will still be difficult. .

vue, before coming out. I have always used ractivejs, which is perfectly compatible with IE8, and Vue has borrowed many of its APIs.

Internet Explorer 8 specific case

Internet Explorer 8 implements the Object.defineProperty() method, but it can only be used on DOM objects.
Some things to note:

Trying to use Object.defineProperty() on a native object will result in an error.
Attribute properties must be set to some specific values. For data property descriptors, the configurable, enumerable and writable attributes must all be set to
true; for accessor property descriptors, configurable must be set to true and enumerable must be set to false. (?)
Any attempt to provide another value (?) will cause an error to be thrown. Reconfiguring an attribute first requires deleting the attribute. If the attribute is not deleted, it will be the same as the previous reconfiguration attempt.

    左手右手慢动作

    No way.
    vue depends on es5’s Object.defineProperty

      習慣沉默

      Are you asking whether you want to use vue for projects or to use vue? If you use vue, don’t consider IE8. New frameworks don’t support it. If you want to do projects that are compatible with IE8, don’t use vue and switch to Avalon

        曾经蜡笔没有小新

        Pass an ordinary JavaScript object to the data option of the Vue instance. Vue will traverse all the properties of this object and use Object.defineProperty to convert all these properties into getters/setters. Object.defineProperty is only supported by ES5 and cannot be shimmed, which is why Vue does not support IE8 and lower browsers.

          Latest Downloads
          More>
          Web Effects
          Website Source Code
          Website Materials
          Front End Template
          About us Disclaimer Sitemap
          php.cn:Public welfare online PHP training,Help PHP learners grow quickly!