新建 vue3 项目

一、环境准备

1、安装 Node

前往参考

2、安装 @vue/cli

  • 安装
shell 复制代码
npm install -g @vue/cli
  • 验证安装
shell 复制代码
vue --version

二、创建 vue3 项目

1、方法一

  • 只是简单的 Vue3 项目
shell 复制代码
vue create vue3-demo


1、方法二

  • 创建基础 Vite + Vue3 + TS 项目
shell 复制代码
npm create vite@latest my-vue3-app -- --template vue-ts



需要自行安装需要的依赖包
  • 安装 Vue Router

    shell 复制代码
    npm install vue-router@4
  • 安装 Pinia

    shell 复制代码
    npm install pinia
  • 安装 Eslint

    shell 复制代码
    npm install -D eslint eslint-plugin-vue @typescript-eslint/parser @typescript-eslint/eslint-plugin

1、方法三

  • 创建 Vue 3 + Vite + TypeScript + ESLint + Pinia + Vue Router 项目
shell 复制代码
npm create vue@latest vue3-demo



相关推荐
掘金安东尼9 小时前
让 JavaScript 更容易「善后」的新能力
前端·javascript·面试
掘金安东尼9 小时前
用 HTMX 为 React Data Grid 加速实时更新
前端·javascript·面试
灵感__idea11 小时前
Hello 算法:众里寻她千“百度”
前端·javascript·算法
yinuo11 小时前
轻松接入大语言模型API -04
前端
袋鼠云数栈UED团队12 小时前
基于 Lexical 实现变量输入编辑器
前端·javascript·架构
cipher12 小时前
ERC-4626 通胀攻击:DeFi 金库的"捐款陷阱"
前端·后端·安全
UrbanJazzerati12 小时前
非常友好的Vue 3 生命周期详解
前端·面试
AAA阿giao12 小时前
从零构建一个现代登录页:深入解析 Tailwind CSS + Vite + Lucide React 的完整技术栈
前端·css·react.js
兆子龙13 小时前
像 React Hook 一样「自动触发」:用 Git Hook 拦住忘删的测试代码与其它翻车现场
前端·架构
兆子龙14 小时前
用 Auto.js 实现挂机脚本:从找图点击到循环自动化
前端·架构