|
@@ -19,12 +19,14 @@ export default class Component {
|
|
const unobservedData = saferEval(dataExpression, {})
|
|
const unobservedData = saferEval(dataExpression, {})
|
|
|
|
|
|
/* IE11-ONLY:START */
|
|
/* IE11-ONLY:START */
|
|
- // For IE11, add our magic properties to the original data for access.
|
|
|
|
- // Since the polyfill proxy does not allow properties to be added after creation
|
|
|
|
- unobservedData.$el = null
|
|
|
|
- unobservedData.$refs = null
|
|
|
|
- unobservedData.$nextTick = null
|
|
|
|
- /* IE11-ONLY:END */
|
|
|
|
|
|
+ if (window.document.documentMode) {
|
|
|
|
+ // For IE11, add our magic properties to the original data for access.
|
|
|
|
+ // Since the polyfill proxy does not allow properties to be added after creation
|
|
|
|
+ unobservedData.$el = null
|
|
|
|
+ unobservedData.$refs = null
|
|
|
|
+ unobservedData.$nextTick = null
|
|
|
|
+ /* IE11-ONLY:END */
|
|
|
|
+ }
|
|
|
|
|
|
// Construct a Proxy-based observable. This will be used to handle reactivity.
|
|
// Construct a Proxy-based observable. This will be used to handle reactivity.
|
|
this.$data = this.wrapDataInObservable(unobservedData)
|
|
this.$data = this.wrapDataInObservable(unobservedData)
|
|
@@ -332,18 +334,20 @@ export default class Component {
|
|
var refObj = {}
|
|
var refObj = {}
|
|
|
|
|
|
/* IE11-ONLY:START */
|
|
/* IE11-ONLY:START */
|
|
- //add any properties that might be necessary for ie11 proxy
|
|
|
|
- refObj.$isRefsProxy = false;
|
|
|
|
- refObj.$isAlpineProxy = false;
|
|
|
|
-
|
|
|
|
- // If we are in IE, since the polyfill needs all properties to be defined before building the proxy,
|
|
|
|
- // we just loop on the element, look for any x-ref and create a the property on a fake object.
|
|
|
|
- // We don't need to put a real value since it will be resolved by the proxy class
|
|
|
|
- this.walkAndSkipNestedComponents(self.$el, el => {
|
|
|
|
- if (el.hasAttribute('x-ref')) {
|
|
|
|
- refObj[el.getAttribute('x-ref')] = true
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ if (window.document.documentMode) {
|
|
|
|
+ //add any properties that might be necessary for ie11 proxy
|
|
|
|
+ refObj.$isRefsProxy = false;
|
|
|
|
+ refObj.$isAlpineProxy = false;
|
|
|
|
+
|
|
|
|
+ // If we are in IE, since the polyfill needs all properties to be defined before building the proxy,
|
|
|
|
+ // we just loop on the element, look for any x-ref and create a the property on a fake object.
|
|
|
|
+ // We don't need to put a real value since it will be resolved by the proxy class
|
|
|
|
+ this.walkAndSkipNestedComponents(self.$el, el => {
|
|
|
|
+ if (el.hasAttribute('x-ref')) {
|
|
|
|
+ refObj[el.getAttribute('x-ref')] = true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
/* IE11-ONLY:END */
|
|
/* IE11-ONLY:END */
|
|
|
|
|
|
|
|
|