1.2.1 • Published 8 months ago

@dsabre/generate-vue-cli v1.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

generate-vue-cli

A Vue CLI to generate components instantly.

Run using npx

npx @dsabre/generate-vue-cli --dir=src/components --name=HelloWorld

Usage

# Usage: npx @dsabre/generate-vue-cli [flags]

# Generate a Vue component.

# Flags:
#   --dir        (required)   The directory where the component will be generated.
#   --name       (required)   The name of the component.
#   --prefix     (optional)   Prefix to prepend to component name.
#   --suffix     (optional)   Suffix to append to component name.
#   --template   (optional)   The template path to use.
#
#   -h, --help   Display this help message and exit.

# Example:
#   npx @dsabre/generate-vue-cli --dir="src/components" --name="HelloWorld" --prefix="Prefix" --suffix="Suffix"`);

Examples

Create a src/components/HelloWorld.vue component:

npx @dsabre/generate-vue-cli --dir=src/components --name=HelloWorld

Using templates

You can specify a custom template of your own (use [[COMPONENT_NAME]] token to print the new component name, it will be replaced when the component is created):

// templates/GenericComponent.vue

<script setup>
const msg = '[[COMPONENT_NAME]] component';
</script>

<template>
    <div>{{ msg }}</div>
</template>

then run:

npx @dsabre/generate-vue-cli --dir=src/components --name=HelloWorld --template=templates/GenericComponent.vue

Authors

License

MIT

1.2.0

8 months ago

1.2.1

8 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

0.0.3

1 year ago

0.0.1

1 year ago