测试平台——前端框架

一、创建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')
相关推荐
Gazer_S2 小时前
【现代前端框架中本地图片资源的处理方案】
前端·javascript·chrome·缓存·前端框架
2403_8751809512 小时前
AI数字人开发,引领科技新潮流
java·大数据·数据结构·人工智能·科技·前端框架
大猫会长15 小时前
react中,在组件内返回style标签方法
前端·react.js·前端框架
codexu18 小时前
Tauri跨端笔记实战(4) - 如何实现系统级截图
前端·前端框架·开源
一路向前的月光20 小时前
React(10)
前端·react.js·前端框架
i建模20 小时前
React + TypeScript 实现数据库逆向生成数据模型指南
sql·typescript·前端框架·react·数据建模·逆向工程·数据模型
不叫猫先生1 天前
【React】合成事件原理
javascript·react.js·前端框架·ecmascript
桂月二二1 天前
现代前端框架渲染机制深度解析:虚拟DOM到编译时优化
前端框架
小刘不知道叫啥1 天前
React 源码揭秘 | 更新队列
前端·react.js·前端框架
bin91532 天前
DeepSeek 助力 Vue 开发:打造丝滑的 复选框(Checkbox)
前端·javascript·vue.js·前端框架·ecmascript·deepseek