截图:
可能原因:标签名写错或者是组件未注册上
实际原因:创建了两个createApp对象
import { createApp } from 'vue'
// import './style.css'
import App from './App.vue'
import router from './router/index'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 如果您正在使用CDN引入,请删除下面一行。
import * as Icons from '@element-plus/icons'
import { toLine } from './utils/index'
const app =createApp(App)
for (const key in Icons) {
console.log('toLine',`el-icon-${toLine((key))}`,'->',(Icons as any)[key]);
app.component(`el-icon-${toLine(key)}`,(Icons as any)[key])
}
//这里又重新创建了一个app实例
createApp(App).use(router).use(ElementPlus).mount('#app')