joken-前端工程师

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: :: :: 管理 ::

Element icons 全局引入方式参考

import type { App } from "vue";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

// 注册所有图标
export function setupElIcons(app: App<Element>) {
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
  }
}

main.ts注册


import { setupElIcons } from "./icons";


export default {
  install(app: App<Element>) {
    // Element-plus图标
    setupElIcons(app);
  },
};
posted on 2024-07-31 22:13  joken1310  阅读(97)  评论(0)    收藏  举报