我想使用hx-swap-oob替换现有页面“带外”的表格行。
在浏览器中:
<table>
<tr id="offer_1">....</tr>
<tr id="offer_2">....</tr> (old)
<tr id="offer_3">....</tr>
</table>
从服务器到客户端:
<table hx-swap-oob="outerHTML:#offer_2" hx-select="#offer_2">
<tr id="offer_2"> .... </tr> (new)
</table>
但到目前为止,结果如下:
<table>
<tr id="offer_1">....</tr>
<table hx-swap-oob="outerHTML:#offer_2" hx-select="#offer_2">
<tr id="offer_2"> .... </tr> (new)
</table>
<tr id="offer_3">....</tr>
</table>
我猜hx-select
当 htmx 从服务器获取此代码段时不会得到评估。
如何在带外交换一行?