g-form <path>
Generates a form component.
Output
${componentsBase}/<subpath>/<name>.js
Options
-i, --input: includes example with<dile-input>-c, --checkbox: includes example with<dile-checkbox>-s, --select: includes example with<dile-select>-r, --radio: includes example with<dile-radio-group>-t, --textarea: includes example with<dile-textarea>--belongs <name>: adds relation support (belongsToandrelationIdproperties) and auto-creates a<dile-input>withname/idset to<name>; intended for<dile-crud-insert>--force: overwrites if the file exists
Example
dile g-form forms/invoice-form -i -t
Example with --belongs:
dile g-form forms/invoice-form --belongs customerId -i
Notes:
- When using
--belongs <name>, the generated component includesbelongsToandrelationId, and infirstUpdated()it assignsrelationIdto the field withid="<name>"whenbelongsTo === "<name>". - It also generates a
<dile-input ... id="<name>">for that field. If you also use-i/--inputand--belongs input, the<dile-input id="input">is not duplicated.
dile CLI