This is a script designed for vuejs cli to create SOC (separation of concern) based components. This is a simple tool to automatically create files and folders for 'separation of concern' components.
-
Follow the Vue CLI guide and setup your vue boilerplate project.
-
Next thing you want to do is pull in the repo into your current project by using git's submodule command.
git submodule add -b master https://github.com/fahimc/vue-component-creator.git
NOTE: If you see nothing inside the folder then run the following command:
git submodule update --init --recursive
- Next you need to run the init script.
node vue-component-creator/init.js
When you wish to create a component, vue-component-creator has included a new npm run script therefore you can use this to create component which will create all the necessary folders and files.
npm run create-component
Once you have done this you will be prompted for the name of your component. After you enter the name of the component, press 'ENTER' to continue.
What is the name of your component?
my-component-name
NOTE: use kebab case only.
Your component has now been created!
You will need to hook it up yourself but you should be ready to build a component.
You can provide the src folder path in the package.json file like so:
"vue-component-creator": {
"src-path": "src/app"
}
Read vue-template webpack documentation for more information on how the repo works.