Home  >  Article  >  Web Front-end  >  Is the project created by cli3 vue2 or vue3?

Is the project created by cli3 vue2 or vue3?

王林
王林Original
2023-05-24 11:43:07630browse

CLI 3 Is the project created using Vue 2 or Vue 3?

In the process of using Vue.js for web development, Vue CLI serves as an important tool to help us create Vue projects. However, during the process of creating a project, some developers may have questions: Is a project created using Vue CLI 3 Vue 2 or Vue 3?

Before answering this question, you need to understand the difference between Vue CLI 3 and Vue CLI 2. Vue CLI 2 is a command line tool for Vue 2, used to create and manage Vue 2-based projects. Vue CLI 3 is a brand new command line tool that not only supports Vue 2, but also Vue 3.

The design concept of Vue CLI 3 is "plug-in", which means that when creating a project, we can choose different plug-ins according to our needs to complete the construction of the project. Therefore, Vue CLI 3 does not force us to choose between Vue 2 or Vue 3 when creating a project. Instead, it provides different preset options for us to choose from, including:

  • Default (Vue 2)
  • Default (Vue 3)
  • Manually select features

As you can see, in the default preset options of Vue CLI 3, we can choose to use Vue 2 or Vue 3. If you select Default (Vue 2), the created project is based on Vue 2; if you select Default (Vue 3), the created project is based on Vue 3. In addition, if we choose Manually select features, we can also custom-select the required functions and plug-ins.

Of course, if we have determined to use Vue 2 or Vue 3, we can also directly use the following command to create the project:

Vue 2 project:

vue create my-project

Vue 3 project:

vue create my-project --preset=@vue/cli-plugin-vue-next

In general, projects created using Vue CLI 3 can be based on Vue 2 or Vue 3. When creating a project, you can freely choose preset options or manually select the required functions and plug-ins. If you need to create a Vue 3 project, you need to use specific commands or preset options.

The above is the detailed content of Is the project created by cli3 vue2 or vue3?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:nodejs json to xmlNext article:nodejs json to xml