步骤
项目中引入ElementPlus分3步:
1.安装ElementPlus
pnpm install element-plus
2.全局导入elementplus
修改main.ts
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
createApp(App).use(ElementPlus).mount('#app')
3.App.vue文件中添加button组件进行测试验证
修改App.vue
<template>
<div class="mb-4">
<el-button>Default</el-button>
<el-button type="primary">Primary</el-button>
<el-button type="success">Success</el-button>
<el-button type="info">Info</el-button>
<el-button type="warning">Warning</el-button>
<el-button type="danger">Danger</el-button>
</div>
</template>