HTMX + Alpine.js + TailwindCSS
This commit is contained in:
parent
b62a2dd8c4
commit
d614f039d3
37 changed files with 114 additions and 233 deletions
public/vendor/htmx-ext
16
public/vendor/htmx-ext/alpine-morph@1.9.12.js
vendored
Normal file
16
public/vendor/htmx-ext/alpine-morph@1.9.12.js
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
htmx.defineExtension('alpine-morph', {
|
||||
isInlineSwap: function (swapStyle) {
|
||||
return swapStyle === 'morph';
|
||||
},
|
||||
handleSwap: function (swapStyle, target, fragment) {
|
||||
if (swapStyle === 'morph') {
|
||||
if (fragment.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
||||
Alpine.morph(target, fragment.firstElementChild);
|
||||
return [target];
|
||||
} else {
|
||||
Alpine.morph(target, fragment.outerHTML);
|
||||
return [target];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue