Caleb Porzio 2 năm trước cách đây
mục cha
commit
2d1b330c9c
2 tập tin đã thay đổi với 9 bổ sung26 xóa
  1. 8 26
      index.html
  2. 1 0
      packages/morph/src/morph.js

+ 8 - 26
index.html

@@ -9,38 +9,20 @@
     <script src="./packages/alpinejs/dist/cdn.js" defer></script>
     <script src="//cdn.tailwindcss.com"></script>
 
-    <div x-data>
-        <h1>Hey!</h1>
-
-        <template x-teleport="body">
-            <h2>Yins!</h2>
-        </template>
-    </div>
-
     <div>
-        <button wire:click="increment">inc</button>
-    </div>
-
-    <div x-data="{ open: @entangle('open') }">
-
-        <input wire:model.defer="count">
-
-        <div wire:dirty wire:target="count">dirty...</div>
-
-        <div x-show="$wire.dirty('count')">dirty...</div>
-        <div x-show="$wire.loading('count')">dirty...</div>
-        <div wire:loading="">dirty...</div>
-        <div wire:loading="">dirty...</div>
+        <!-- if -->
+        <div>foo<input></div>
+        <!-- end -->
 
+        <div>bar<input></div>
     </div>
 
     <main x-data x-ignore style="display: none">
-        <div x-data>
-            <h1>there!</h1>
+        <div>
+            <!-- if -->
+            <!-- end -->
 
-            <template x-teleport="body">
-                <h2>Yons!</h2>
-            </template>
+            <div>bar<input></div>
         </div>
     </main>
 

+ 1 - 0
packages/morph/src/morph.js

@@ -160,6 +160,7 @@ export async function morph(from, toHtml, options) {
             let toKey = getKey(currentTo)
             let domKey = getKey(currentFrom)
 
+            debugger
             // Add new elements
             if (! currentFrom) {
                 if (toKey && domKeyHoldovers[toKey]) {