I'm new to vue so I'm wondering if there's something I can leverage to help me automate/scaffold some common Vue activites. I'm talking about creating components, creating a vue-router,etc.
Angular has something like this build into it's Angular CLI. (e.g. ng generate c my-component
will generate a sub-folder named '/my-component' folder and add 3 files in there with some pre-written code). This helps speed up development. Now I do like how concise Vue is and it's not that difficult to create components etc. But I wanted to ask to see if I'm missing something obvious.
Please be kind I'm new to vue and quite frankly npm as well.
CodePudding user response:
Yes, Vue has a command line interface (CLI) that can help you automate common tasks when working with Vue. The Vue CLI is a npm package, so you can install it by running the following command:
npm install -g @vue/cli
Once you have the Vue CLI installed, you can use it to create a new Vue project and other related tasks
vue create my-project
cd my-project
vue generate component MyComponent
vue add router