refactor(projects): 单独路由逻辑重构、路由转换函数优化

This commit is contained in:
Soybean
2022-01-06 02:00:42 +08:00
parent c804b21ceb
commit b36a62b150
45 changed files with 4976 additions and 330 deletions

19
src/utils/common/icon.ts Normal file
View File

@@ -0,0 +1,19 @@
import { h } from 'vue';
import { Icon } from '@iconify/vue';
/**
* 动态渲染iconify
* @param icon - 图标名称
* @param color - 图标颜色
* @param size - 图标大小
*/
export function iconifyRender(icon: string, color?: string, size?: number) {
const style: { color?: string; size?: string } = {};
if (color) {
style.color = color;
}
if (size) {
style.size = `${size}px`;
}
return () => h(Icon, { icon, style });
}

View File

@@ -2,4 +2,5 @@ export * from './typeof';
export * from './console';
export * from './color';
export * from './number';
export * from './icon';
export * from './design-pattern';