소스 검색

add clone as second param

Kevin Batdorf 4 년 전
부모
커밋
c0c2f43094
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/component.js

+ 2 - 2
src/component.js

@@ -41,7 +41,7 @@ export default class Component {
             // to be defined after the proxy object is created so,
             // for IE only, we need to define our helpers earlier.
             Object.entries(Alpine.magicProperties).forEach(([name, callback]) => {
-                Object.defineProperty(this.unobservedData, `$${name}`, { get: function () { return callback(this.$el) } });
+                Object.defineProperty(this.unobservedData, `$${name}`, { get: function () { return callback(canonicalComponentElementReference, this.$el) } });
             })
         /* IE11-ONLY:END */
 
@@ -74,7 +74,7 @@ export default class Component {
 
         // Register custom magic properties.
         Object.entries(Alpine.magicProperties).forEach(([name, callback]) => {
-            Object.defineProperty(this.unobservedData, `$${name}`, { get: function () { return callback(this.$el) } });
+            Object.defineProperty(this.unobservedData, `$${name}`, { get: function () { return callback(canonicalComponentElementReference, this.$el) } });
         })
         /* MODERN-ONLY:END */