15 lines
501 B
TypeScript
15 lines
501 B
TypeScript
import { toHump } from "@/lib/util";
|
|
|
|
const icon = (iconName: string) => {
|
|
if (!iconName) return;
|
|
const name = toHump(iconName, "-");
|
|
if(name === "IconInbox" || name === "IconSendDoc" || name === "IconSetting") {
|
|
const svgIcon = () => import(`./svgIcon/${name}.vue`);
|
|
return defineAsyncComponent(svgIcon);
|
|
}else{
|
|
const antdIcons = () => import(`../../node_modules/@ant-design/icons-vue/es/icons/${name}.js`);
|
|
return defineAsyncComponent(antdIcons);
|
|
}
|
|
};
|
|
|
|
export default icon; |