基础使用
一下所有笔记均在官方文档摘录的基础上添加,新手用户请务必去官网看一遍
npm、yarn
- vue3.x
# vue@next 最新稳定版
# @vue/compiler-sfc *.vue文件支持-单组件支持
$ npm install vue@next @vue/compiler-sfc
vue-cli创建
- 安装
yarn global add @vue/cli
# 或
npm install -g @vue/cli
- 使用
vue upgrade
vite 创建
- 安装vite
# npm 6.x
$ npm init vite@latest <project-name> --template vue
# npm 7+,需要加上额外的双短横线
$ npm init vite@latest <project-name> -- --template vue
$ cd <project-name>
$ npm install
$ npm run dev
# yarn
$ yarn create vite <project-name> --template vue
$ cd <project-name>
$ yarn
$ yarn dev
# pnpm
$ pnpm create vite <project-name> -- --template vue
$ cd <project-name>
$ pnpm install
$ pnpm dev