hx-paramshx-params 属性允许你过滤将随 AJAX 请求提交的参数。
¥The hx-params attribute allows you to filter the parameters that will be submitted with an AJAX request.
此属性的可能值为:
¥The possible values of this attribute are:
* - 包含所有参数(默认)
¥* - Include all parameters (default)
none - 不包含任何参数
¥none - Include no parameters
not <param-list> - 包括除逗号分隔的参数名称列表之外的所有内容
¥not <param-list> - Include all except the comma separated list of parameter names
<param-list> - 包括所有逗号分隔的参数名称列表
¥<param-list> - Include all the comma separated list of parameter names
<div hx-get="/example" hx-params="*">Get Some HTML, Including Params</div>
此 div 将包含 POST 的所有参数,但它们将被 URL 编码并包含在 URL 中,就像 GET 一样。
¥This div will include all the parameters that a POST would, but they will be URL encoded
and included in the URL, as per usual with a GET.
¥Notes
hx-params 是继承的,可以放在父元素上
¥hx-params is inherited and can be placed on a parent element