Skip to content

Commit 1120424

Browse files
committed
wip
1 parent 07457eb commit 1120424

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/docs/src/en/plugins/morph.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,15 @@ By adding keys to each node, we can accomplish this like so:
250250
Now that there are "keys" on the `<li>`s, Morph will match them in both trees and move them accordingly.
251251

252252
You can configure what Morph considers a "key" with the `key:` configuration option. [More on that here](#lifecycle-hooks)
253+
254+
<a name="alpine-morph-between"></a>
255+
## Alpine.morphBetween()
256+
257+
The `Alpine.morphBetween(startMarker, endMarker, newHtml, options)` method allows you to morph a range of DOM nodes between two marker elements based on passed in HTML. This is useful when you want to update only a specific section of the DOM without providing a single root node.
258+
259+
| Parameter | Description |
260+
| --- | --- |
261+
| `startMarker` | A DOM node (typically a comment node) that marks the beginning of the range to morph |
262+
| `endMarker` | A DOM node (typically a comment node) that marks the end of the range to morph |
263+
| `newHtml` | A string of HTML or a DOM element to replace the content between the markers |
264+
| `options` | An object of options (same as `Alpine.morph()`) |

0 commit comments

Comments
 (0)