feat: update attr documentation
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
4b31bd4774
commit
d89541a762
2 changed files with 10 additions and 9 deletions
|
|
@ -268,14 +268,15 @@ func (f *Field) WithOptions(options ...*Option) *Field
|
|||
|
||||
#### Common options
|
||||
|
||||
| Name | type | description | Info |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| `required` | `bool` | Add `required="true"` | Does not apply a constraint |
|
||||
| `attr` | `map[string]string` | List of extra attributes of the field | |
|
||||
| `row_attr` | `map[string]string` | List of extra attributes of the field's top container | |
|
||||
| `label` | `string` | The label of the field | Usually show before the field |
|
||||
| `label_attr` | `map[string]string` | List of extra attributes of the label | |
|
||||
| `help` | `string` | Helper of the field | |
|
||||
| Name | type | description | Info |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| `required` | `bool` | Add `required="true"` | Does not apply a constraint |
|
||||
| `attr` | `form.Attrs` | List of extra attributes of the field | |
|
||||
| `row_attr` | `form.Attrs` | List of extra attributes of the field's top container | |
|
||||
| `label` | `string` | The label of the field | Usually show before the field |
|
||||
| `label_attr` | `form.Attrs` | List of extra attributes of the label | |
|
||||
| `help` | `string` | Helper of the field | |
|
||||
| `help_attr` | `form.Attrs` | List of extra attributes of the help | |
|
||||
|
||||
Appends options to the field
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ Some options are natively supported in go-form themes.
|
|||
myForm.WithOptions(
|
||||
form.NewOption("help", "A help for the form"),
|
||||
// <form data-foo="bar" data-bar="bar" ...
|
||||
form.NewOption("attr", map[string]string{
|
||||
form.NewOption("attr", form.Attrs{
|
||||
"data-foo": "foo",
|
||||
"data-bar": "bar",
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue