[Vue] Use Vue CLI scaffolding to create a Vue project (created using the command line)

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

  1. 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.

  2. 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).

    Manual configuration options

  3. 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.

  4. After completing the configuration, Vue CLI will automatically download and install the required dependencies and generate a basic Vue project structure.
    Create project

  5. After creation is complete, you can enter the project directory and start the development server:

    cd my-project
    npm run serve
    

    Project operation

  6. Then, you can visithttp://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.

Guess you like

Origin blog.csdn.net/qq_34988204/article/details/134770914