logo dile-components dile CLI

g-action <path>

Generates an "action" 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-action actions/delete-action

# Generates file: src/components/actions/my-app-delete-action.js
# With:
# - Component tag: <my-app-delete-action></my-app-delete-action>
# - Class name: MyAppDeleteAction
# - customElements.define('my-app-delete-action', MyAppDeleteAction)

Example

Without prefix:

dile g-action actions/demo-change-name-action -i

With prefix configured (componentPrefix: 'dile'):

dile g-action actions/demo-change-name-action -i
# Generates: src/components/actions/dile-demo-change-name-action.js