随笔 - 111  文章 - 0  评论 - 1  阅读 - 30133

求助,路过的大佬帮忙看一下!!!!elment中input组件使用prefix-icon="el-icon-search"不加载图标

背景:创建了一个简单的vue工程想用测试一下el-input组件的功能,没有显示图标。代码如下所示

复制代码
<template>
    <el-input v-model="value"
    placeholder="请输入内容"
    :disabled="false"
    :show-password="true"
    :clearable="true"
    prefix-icon="el-icon-edit"
    type="text"></el-input>
</template>

<script  setup>
import { ref } from 'vue'
const value = ref('')
</script>
复制代码

 其中在main.js中定义了图标的加载

复制代码
import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// import * as ElIconModules from '@element-plus/icons'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'



const app = createApp(App)
//  统一注册el-icon图标
// for(let iconName in ElIconModules){
//   app.component(iconName,ElIconModules[iconName])
// }
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus)
app.mount('#app')
复制代码

 

posted on   昨夜小楼听风雨  阅读(277)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· 25岁的心里话
历史上的今天:
2023-03-27 微信小程序----手机号授权操作
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示