一、项目创建
vue create vue3-ts-app //创建vue3项目
自己配置依赖(根据个人习惯)
cd vue3-ts-app //定位文件
npm run serve //启动项目
8080端口启动成功
二、目录分析
三、element plus 安装--安装 | Element Plus
1、安装
npm install element-plus --save
2、 引入
// main.ts
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
createApp(App).use(router).use(ElementPlus).mount('#app') //链式编程注入
3、测试
#App.vue
<template>
<el-button type="primary">Primary</el-button> //上方添加一个按钮
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view/>
</template>
查看效果