logo dile-components dile CLI

g-form <path>

Generates a form component.

Output

Options

Component Prefix

If a componentPrefix is configured in your dile.config.js, the component name will include this prefix:

# With componentPrefix: 'my-app' in configuration
dile g-form forms/user-form

# Generates file: src/components/forms/my-app-user-form.js
# With:
# - Component tag: <my-app-user-form></my-app-user-form>
# - Class name: MyAppUserForm
# - customElements.define('my-app-user-form', MyAppUserForm)

Example

Without prefix:

dile g-form forms/invoice-form -i -t

With prefix configured (componentPrefix: 'dile'):

dile g-form forms/invoice-form -i -t
# Generates: src/components/forms/dile-invoice-form.js

Example with --belongs:

dile g-form forms/invoice-form --belongs customerId -i

Notes: