提交前字段映射

查看源码

属性参考

注册名 data-controller="button-to"
Targets
Values
Outlets

提交前按 mappings value 把页面上其它输入框的值拷贝进表单字段,例如验证码表单提交时把身份信息一并带上。

<form data-controller="button-to" data-button-to-mappings-value='{"identity":"identity_input"}'>
  <input type="hidden" name="identity">
  <button type="submit">提交</button>
</form>