测试平台——前端框架

一、创建vue项目

npm init vite@latest web_class

复制代码
wyl@WYLdeMacBook-Air testplatform % npm init vite@latest web_class   
✔ Select a framework: › Vue
✔ Select a variant: › JavaScript

Scaffolding project in /Users/wyl/workspace/testplatform/web_class...

Done. Now run:

  cd web_class
  npm install
  npm run dev

wyl@WYLdeMacBook-Air testplatform % 

二、安装插件

三、打开项目

文件-打开文件夹,选择项目根目录(web_class目录)

四、运行

终端-新建终端

输入 npm run dev,提示:sh: vite: command not found

复制代码
wyl@WYLdeMacBook-Air web_class % npm run dev

> web_class@0.0.0 dev
> vite

sh: vite: command not found
wyl@WYLdeMacBook-Air web_class %

输入 npm i ,安装项目需要的包,卡住不执行了

复制代码
wyl@WYLdeMacBook-Air web_class % npm i
(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ idealTree:web_class: sill idealTree buildDeps

清除缓存,设置镜像源

复制代码
wyl@WYLdeMacBook-Air web_class % npm cache verify
Cache verified and compressed (~/.npm/_cacache)
Content verified: 5 (11813355 bytes)
Index entries: 5
Finished in 0.024s
wyl@WYLdeMacBook-Air web_class % npm config set registry https://registry.npmmirror.com

wyl@WYLdeMacBook-Air web_class % npm config get registry

https://registry.npmmirror.com
wyl@WYLdeMacBook-Air web_class % 

重新安装包,运行

复制代码
wyl@WYLdeMacBook-Air web_class % npm i

added 28 packages in 43s
wyl@WYLdeMacBook-Air web_class % npm run  dev

> web_class@0.0.0 dev
> vite


  VITE v5.1.6  ready in 894 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
15:01:08 [vite] hmr update /src/App.vue
15:01:23 [vite] hmr update /src/App.vue (x2)

浏览器打开http://localhost:5173/ ,访问页面

五、引入element

element 官网:快速开始 | Element Plus

安装:npm install element-plus --save

引入包:

import ElementPlus from 'element-plus'

import 'element-plus/dist/index.css'

复制代码
// main.ts
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'

const app = createApp(App)

app.use(ElementPlus)
app.mount('#app')
相关推荐
Lee川1 天前
🌐 深入 Chrome 浏览器:从单线程到多进程架构的进化之路
前端·架构·前端框架
优秀稳妥的JiaJi2 天前
分享一篇后台管理系统的通用skills
前端·vue.js·前端框架
RaidenLiu2 天前
Flutter Platform Channel 底层架构解析 —— 从 BinaryMessenger 到跨平台消息通信机制
前端·flutter·前端框架
勤劳打代码4 天前
Flutter 架构日记 — 状态管理
flutter·架构·前端框架
优秀稳妥的JiaJi5 天前
基于腾讯地图实现电子围栏绘制与校验
前端·vue.js·前端框架
uuware6 天前
Lupine.Press + AI 助您分分钟搞定技术项目的文档网站
人工智能·前端框架
StarkCoder10 天前
SwiftUI路由管理架构揭秘:从混乱到优雅的蜕变
前端框架
青青家的小灰灰11 天前
React 架构进阶:自定义 Hooks 的高级设计模式与最佳实践
前端·react.js·前端框架
一枚前端小姐姐12 天前
低代码平台表单设计系统技术分析(实战二)
低代码·架构·前端框架
百思可瑞教育13 天前
Vue 前端与 Node.js 后端文件上传与处理实现
前端·javascript·vue.js·前端框架·node.js·ecmascript·百思可瑞教育