hx-ext

hx-ext 属性为一个元素及其所有子元素启用一个 htmx extension

值可以是一个扩展名称或逗号分隔的要应用的扩展列表。

如果您希望插件应用于整个 DOM 区域,可以将 hx-ext 标签放置在父元素上, 并放置在 body 标签上以应用于所有 htmx 请求。

注意事项

<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>