全局引入icons
main.js文件引入icons
1 2 3 4 5 |
import * as ELIcons from '@element-plus/icons-vue' const app = createApp(App) for (let iconName in ELIcons) { app.component(iconName, ELIcons[iconName]) } |
当然,仅在当前view中引入也可以
1 |
import * from '@element-plus/icons-vue' |
然后使用prefix或suffix插槽,<el-input prefix-icon=”………”>方法在我的场景下无效
1 2 3 4 5 6 7 8 9 10 |
<el-input v-model="filterText" placeholder="输入关键字进行搜索" > <template #prefix> <el-icon> <Search /> </el-icon> </template> </el-input> |