Vue 3.0 + Vite搭建项目环境

 

简述:1、vue使用vite搭建项目环境npm init vite-app <project-name>cd <project-name>根据控制台的提示执行:npm install / yarnnpm run dev / yarn dev

详情:

1、vue使用vite搭建项目环境

npm升级:npm install -g npm


  官网 https://cn.vitejs.dev/guide/

npm init vite-app 项目名

cd 项目名

根据控制台的提示执行:

npm install / yarn

npm run dev / yarn dev

 2、vue3.0常用的安装插件及使用

(1)vue-router安装和使用

安装:npm install vue-router@next

(2)element-plus安装和使用

安装:cnpm i element-plus -S

import 'element-plus/lib/theme-chalk/index.css'

import ElementPlus from 'element-plus'

app.use(ElementPlus)