hx-exthx-ext 属性为一个元素及其所有子元素启用一个 htmx extension。
值可以是一个扩展名称或逗号分隔的要应用的扩展列表。
如果您希望插件应用于整个 DOM 区域,可以将 hx-ext 标签放置在父元素上,
并放置在 body 标签上以应用于所有 htmx 请求。
hx-ext 既被继承又与父元素合并,因此您可以在 DOM
层次结构中的任何元素上指定扩展,它将应用于所有子元素。
您可以使用 hx-ext="ignore:extensionName" 忽略由父节点定义的扩展。
<div hx-ext="example">
"Example" extension is used in this part of the tree...
<div hx-ext="ignore:example">
... but it will not be used in this part.
</div>
</div>
<body hx-ext="preload,morph">
"preload" and "morph" extensions are used in this part of the tree...
</body>