search

Home  >  Q&A  >  body text

How is vue compatible with IE8?

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

PHP中文网PHP中文网2779 days ago1250

reply all(4)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-19 10:32:50

    The data changes of

    vue.js are dependent on Object.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.

    reply
    0
  • ringa_lee

    ringa_lee2017-05-19 10:32:50

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

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-19 10:32:50

    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

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-19 10:32:50

    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.

    reply
    0
  • Cancelreply