vue-gen-comp-cli
v6.0.0
Published
A CLI tool to generate 4-file split Vue components
Maintainers
Readme
vue-gen-comp-cli
npm config set //registry.npmjs.org/:_authToken=YOUR_TOKEN_HERE
A simple CLI tool to generate a 4-file split Vue component structure.
Features
This command creates:
- a Vue file
- an HTML file
- a JavaScript file
- a CSS file
inside a new component folder.
Installation
Install it globally with:
npm install -g vue-gen-comp-cliOr use it locally in a project:
npm install --save-dev vue-gen-comp-cliGenerate a component
From your Vue project root, run:
make-vue-comp MyComponentThis will create a folder like:
src/MyComponent/with these files:
src/MyComponent/MyComponent.vue
src/MyComponent/MyComponent.html
src/MyComponent/MyComponent.js
src/MyComponent/MyComponent.cssCreate a component in a subfolder
make-vue-comp components/forms/UserCardThis will generate the component under:
src/components/forms/UserCard/