第一步:npm install @element-plus/icons-vue
第二步:在main.js
里
javascript
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
第三步:在你需要用的地方页面
(1)按钮:
javascript
<el-button size="small" type="primary" :icon="Edit" @click="openEditFileInfoModal(scope.row)">编辑</el-button>
<el-button size="small" type="danger" :icon="Delete" @click="deleteDownLoadList(scope.row.id)">删除</el-button>
(2)自定义:
javascript
<el-button type="primary" @click="openAddCoverFile"><el-icon style="margin: 0 4px 0 0"><CirclePlus /></el-icon>新增</el-button>
<el-button type="primary" @click="chooseVideo">上传视频<el-icon class="el-icon--right"><UploadFilled /></el-icon></el-button>