物业代码生成
This commit is contained in:
7
packages/@core/base/icons/build.config.ts
Normal file
7
packages/@core/base/icons/build.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { defineBuildConfig } from 'unbuild';
|
||||
|
||||
export default defineBuildConfig({
|
||||
clean: true,
|
||||
declaration: true,
|
||||
entries: ['src/index'],
|
||||
});
|
41
packages/@core/base/icons/package.json
Normal file
41
packages/@core/base/icons/package.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@vben-core/icons",
|
||||
"version": "5.5.6",
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
|
||||
"directory": "packages/@vben-core/base/icons"
|
||||
},
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm unbuild"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"main": "./dist/index.mjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/index.ts",
|
||||
"development": "./src/index.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/vue": "catalog:",
|
||||
"lucide-vue-next": "catalog:",
|
||||
"vue": "catalog:"
|
||||
}
|
||||
}
|
30
packages/@core/base/icons/src/create-icon.ts
Normal file
30
packages/@core/base/icons/src/create-icon.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { defineComponent, h } from 'vue';
|
||||
|
||||
import { addIcon, Icon, type IconifyIcon } from '@iconify/vue';
|
||||
|
||||
function createIconifyIcon(icon: string) {
|
||||
return defineComponent({
|
||||
name: `Icon-${icon}`,
|
||||
setup(props, { attrs }) {
|
||||
return () => h(Icon, { icon, ...props, ...attrs });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建离线图标
|
||||
* @param icon 图标名称 建议与iconify的名称保持一致
|
||||
* @param iconComponent 从@iconify/icon-xxx/xxx导入的图标
|
||||
* @returns IconComponent
|
||||
*/
|
||||
function createIconifyOfflineIcon(icon: string, iconComponent: IconifyIcon) {
|
||||
return defineComponent({
|
||||
name: `Icon-${icon}`,
|
||||
setup(props, { attrs }) {
|
||||
addIcon(icon, iconComponent);
|
||||
return () => h(Icon, { icon, ...props, ...attrs });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export { createIconifyIcon, createIconifyOfflineIcon };
|
16
packages/@core/base/icons/src/index.ts
Normal file
16
packages/@core/base/icons/src/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export * from './create-icon';
|
||||
|
||||
export * from './lucide';
|
||||
|
||||
export type { IconifyIcon as IconifyIconStructure } from '@iconify/vue';
|
||||
export {
|
||||
addCollection,
|
||||
addIcon,
|
||||
Icon as IconifyIcon,
|
||||
listIcons,
|
||||
} from '@iconify/vue';
|
||||
|
||||
/**
|
||||
* 从@iconify/vue/dist/offline'导出的组件为离线ICON 不支持在线
|
||||
* 从@iconify/vue'导出的组件为在能找到本地图标为离线 否则会在线获取(适用性更强)
|
||||
*/
|
68
packages/@core/base/icons/src/lucide.ts
Normal file
68
packages/@core/base/icons/src/lucide.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
export {
|
||||
ArrowDown,
|
||||
ArrowLeft,
|
||||
ArrowLeftToLine,
|
||||
ArrowRightLeft,
|
||||
ArrowRightToLine,
|
||||
ArrowUp,
|
||||
ArrowUpToLine,
|
||||
Bell,
|
||||
BookOpenText,
|
||||
Check,
|
||||
ChevronDown,
|
||||
ChevronLeft,
|
||||
ChevronRight,
|
||||
ChevronsLeft,
|
||||
ChevronsRight,
|
||||
Circle,
|
||||
CircleAlert,
|
||||
CircleCheckBig,
|
||||
CircleHelp,
|
||||
CircleX,
|
||||
Copy,
|
||||
CornerDownLeft,
|
||||
Ellipsis,
|
||||
Expand,
|
||||
ExternalLink,
|
||||
Eye,
|
||||
EyeOff,
|
||||
FoldHorizontal,
|
||||
Fullscreen,
|
||||
Github,
|
||||
Grip,
|
||||
GripVertical,
|
||||
Menu as IconDefault,
|
||||
Info,
|
||||
InspectionPanel,
|
||||
Languages,
|
||||
LoaderCircle,
|
||||
LockKeyhole,
|
||||
LogOut,
|
||||
MailCheck,
|
||||
Maximize,
|
||||
ArrowRightFromLine as MdiMenuClose,
|
||||
ArrowLeftFromLine as MdiMenuOpen,
|
||||
Menu,
|
||||
Minimize,
|
||||
Minimize2,
|
||||
MoonStar,
|
||||
Palette,
|
||||
PanelLeft,
|
||||
PanelRight,
|
||||
Pin,
|
||||
PinOff,
|
||||
Plus,
|
||||
RotateCw,
|
||||
Search,
|
||||
SearchX,
|
||||
Settings,
|
||||
Shrink,
|
||||
Square,
|
||||
SquareCheckBig,
|
||||
SquareMinus,
|
||||
Sun,
|
||||
SunMoon,
|
||||
SwatchBook,
|
||||
UserRoundPen,
|
||||
X,
|
||||
} from 'lucide-vue-next';
|
6
packages/@core/base/icons/tsconfig.json
Normal file
6
packages/@core/base/icons/tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "@vben/tsconfig/web.json",
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
Reference in New Issue
Block a user