Preface
Before we start developing with Vue, we need to create a Vue project. Vue CLI (Command Line Interface) is an officially provided scaffolding tool that can help us quickly create Vue projects.
step
-
Open a terminal or command line tool and run the following command:
vue create my-project
Among them,
my-project
is the name of your project, which you can modify according to your needs. -
After running the above command, Vue CLI will prompt you to select a preset configuration. You can choose the default configuration (default) or manually select features (Manually select features).
-
If you choose manual configuration, Vue CLI will provide a series of options for you to choose the required features, such as Babel, ESLint, Router, etc.
-
After completing the configuration, Vue CLI will automatically download and install the required dependencies and generate a basic Vue project structure.
-
After creation is complete, you can enter the project directory and start the development server:
cd my-project npm run serve
-
Then, you can visit
http://localhost:8080
in the browser to view your Vue project.
Summarize
At this point, you have successfully created a Vue project and can start development. During the development process, you can use other commands provided by Vue CLI to help you with project building, packaging, etc. For specific commands and usage, please refer to the official documentation of Vue CLI.