使用 element-plus 时发现了一个问题:icon 需要单独安装和引入,让我很是难受,官网是这么说的(大概意思如下):
$ yarn add @element-plus/icons
# 或者
$ npm install @element-plus/icons
import { defineComponent } from 'vue'
import { Edit, Share, Delete, Search } from '@element-plus/icons'
export default defineComponent({
components: { Edit, Share, Delete, Search }
})
<template>
<div style="font-size: 20px;">
<!-- Since svg icons do not carry any attributes by default -->
<!-- You need to provide attributes directly -->
<el-icon size="1em"><edit /></el-icon>
<el-icon size="1em"><share /></el-icon>
<el-icon size="1em"><delete /></el-icon>
<el-icon size="1em"><search /></el-icon>
</div>
</template>
… 说真