30dd63b47e
* storybook: add .md suffix to stories blueprint * storybook: add FormField * storybook: update AuthConfigForm docs * storybook: add FormFieldGroups * storybook: add MaskedInput * storybook: add example FormField attr * storybook: remove actions addon
1.3 KiB
1.3 KiB
FormField
FormField
components are field elements associated with a particular model.
Param | Type | Default | Description |
---|---|---|---|
[onChange] | Func |
|
Called whenever a value on the model changes via the component. |
attr | Object |
|
This is usually derived from ember model attributes lookup, and all members of attr.options are optional. |
model | DS.Model |
|
The Ember Data model that attr is defined on |
Example Attr
{
name: "foo",
options: {
label: "Foo",
defaultValue: "",
editType: "ttl",
helpText: "This will be in a tooltip"
},
type: "boolean"
}
Example
{{#each @model.fields as |attr|}}
<FormField data-test-field @attr={{attr}} @model={{this.model}} />
{{/each}}
See