Use vue-cli2 to initialize the project and analyze the directory structure


1 Introduction

Use vue --versionView vue install their own version if your version of vue-cli in 3 or more, still want to use vue-cli2, you will need to install a bridging tool.

The vue-cli official website explains it like this: Vue CLI >= 3 uses the same vue command as the previous version, so Vue CLI 2 (vue-cli) is overwritten. If you still need to use the old version of vue init function, you can install a bridging tool globally:

# 安装桥接工具
npm install -g @vue/cli-init

# `vue init` 的运行效果将会跟 `[email protected]` 相同
vue init webpack my-project

2. vue-cli2 initialization project

Use the command vue init webpack 项目名称
Insert picture description here
blog post was written quite detailed: https://www.cnblogs.com/landuo629/p/12468893.html

3. Project directory structure

Borrow a few pictures from coderwhy teacher
Insert picture description here

Use npm run buildand npm run devexecution time code commands:
Insert picture description here
Insert picture description here
recommend a blog directory structure vue-cli project presentation

Guess you like

Origin blog.csdn.net/weixin_43974265/article/details/112729146