0. 搭建环境

需要环境:Git、Node.js

使用编辑器:VSCode

1.Git 环境配置

1
2
# 推送当前文件夹所有文件
git add.

2.Node.js 环境配置

1
2
3
4
# 更换 npm 镜像源
npm config set registry https://registry.npmmirror.com
# 查看当前 npm 镜像源
npm config get registry

1. 直接使用 vue3 脚手架

快速上手 | Vue.js

1
2
# vue3 官方最新脚手架
npm create vue@latest

npm init -y 初始化项目

会生成 package.json 项目配置文件

npm i 默认下载package.json中所有依赖

npm run dev 跑

public favicon.ico 图标

assets 静态资源

components 组件

router “路由表”存储页面路径

stores 全局变量

main.js 入口文件

RouterView - 路由的出口

< RouterLink =超链接

1
<script setup> 语法糖

console.log() - F12控制台打印


Vibe-coding 使用 命令行 创建 Vue3 项目