测试平台——前端框架

一、创建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')
相关推荐
Codebee2 小时前
OneCode自主UI设计体系:架构解析与核心实现
前端·javascript·前端框架
jingling5555 小时前
面试版-前端开发核心知识
开发语言·前端·javascript·vue.js·面试·前端框架
伍哥的传说7 小时前
鸿蒙系统(HarmonyOS)应用开发之手势锁屏密码锁(PatternLock)
前端·华为·前端框架·harmonyos·鸿蒙
青松学前端9 小时前
vue-2.7源码解读之初始化流程和响应式实现
前端·vue.js·前端框架
杨进军9 小时前
前端线上问题的那些事儿
前端·javascript·前端框架
样子20181 天前
Vue3 之dialog弹框简单制作
前端·javascript·vue.js·前端框架·ecmascript
weixin_404611341 天前
关于微前端框架micro,子应用设置--el-primary-color失效的问题
前端框架
摸鱼仙人~1 天前
重塑智能体决策路径:深入理解 ReAct 框架
前端·react.js·前端框架
如果'\'真能转义说1 天前
React自学 基础一
前端·react.js·前端框架
患得患失9491 天前
【前端】【React】【数字孪生】全解react使用threejs,@react-three/fiber,@react-three/drei
前端·react.js·前端框架