diff --git a/.env.base b/.env.base index 8f60256..1c8fd7c 100644 --- a/.env.base +++ b/.env.base @@ -17,4 +17,4 @@ VITE_USE_ALL_ELEMENT_PLUS_STYLE=true VITE_USE_MOCK=true # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true diff --git a/.env.dev b/.env.dev index 4727386..a4d6b3a 100644 --- a/.env.dev +++ b/.env.dev @@ -35,4 +35,4 @@ VITE_USE_MOCK=true VITE_USE_CSS_SPLIT=true # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true diff --git a/.env.gitee b/.env.gitee index bcd0b11..1a14f0a 100644 --- a/.env.gitee +++ b/.env.gitee @@ -35,4 +35,4 @@ VITE_USE_MOCK=true VITE_USE_CSS_SPLIT=true # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true diff --git a/.env.pro b/.env.pro index a35e73b..edc668e 100644 --- a/.env.pro +++ b/.env.pro @@ -35,4 +35,4 @@ VITE_USE_MOCK=true VITE_USE_CSS_SPLIT=true # 是否使用在线图标 -VITE_USE_ONLINE_ICON=false \ No newline at end of file +VITE_USE_ONLINE_ICON=false diff --git a/.env.test b/.env.test index ee881dd..b53f347 100644 --- a/.env.test +++ b/.env.test @@ -35,4 +35,4 @@ VITE_USE_MOCK=true VITE_USE_CSS_SPLIT=false # 是否使用在线图标 -VITE_USE_ONLINE_ICON=true \ No newline at end of file +VITE_USE_ONLINE_ICON=true diff --git a/mock/menu/index.mock.ts b/mock/menu/index.mock.ts index fd3f732..092dbc5 100644 --- a/mock/menu/index.mock.ts +++ b/mock/menu/index.mock.ts @@ -26,7 +26,7 @@ export default [ title: '首页', meta: { title: '首页', - icon: 'ant-design:dashboard-filled', + icon: 'vi-ant-design:dashboard-filled', alwaysShow: true }, children: [ @@ -90,7 +90,7 @@ export default [ component: '#', meta: { title: '文档', - icon: 'clarity:document-solid' + icon: 'vi-clarity:document-solid' }, name: 'ExternalLink', status: Mock.Random.integer(0, 1), @@ -125,7 +125,7 @@ export default [ title: '菜单', meta: { title: '菜单', - icon: 'carbon:skill-level-advanced' + icon: 'vi-carbon:skill-level-advanced' }, children: [ { @@ -214,7 +214,7 @@ export default [ title: '综合示例', meta: { title: '综合示例', - icon: 'ep:management', + icon: 'vi-ep:management', alwaysShow: true }, children: [ diff --git a/mock/role/index.mock.ts b/mock/role/index.mock.ts index 7aae345..a0ec69c 100644 --- a/mock/role/index.mock.ts +++ b/mock/role/index.mock.ts @@ -12,7 +12,7 @@ const adminList = [ name: 'Dashboard', meta: { title: 'router.dashboard', - icon: 'ant-design:dashboard-filled', + icon: 'vi-ant-design:dashboard-filled', alwaysShow: true }, children: [ @@ -49,7 +49,7 @@ const adminList = [ name: 'DocumentLink', meta: { title: 'router.document', - icon: 'clarity:document-solid' + icon: 'vi-clarity:document-solid' } } ] @@ -66,7 +66,7 @@ const adminList = [ name: 'GuideDemo', meta: { title: 'router.guide', - icon: 'cib:telegram-plane' + icon: 'vi-cib:telegram-plane' } } ] @@ -78,7 +78,7 @@ const adminList = [ name: 'ComponentsDemo', meta: { title: 'router.component', - icon: 'bx:bxs-component', + icon: 'vi-bx:bxs-component', alwaysShow: true }, children: [ @@ -358,7 +358,7 @@ const adminList = [ name: 'Function', meta: { title: 'router.function', - icon: 'ri:function-fill', + icon: 'vi-ri:function-fill', alwaysShow: true }, children: [ @@ -406,7 +406,7 @@ const adminList = [ name: 'Hooks', meta: { title: 'hooks', - icon: 'ic:outline-webhook', + icon: 'vi-ic:outline-webhook', alwaysShow: true }, children: [ @@ -467,7 +467,7 @@ const adminList = [ name: 'Level', meta: { title: 'router.level', - icon: 'carbon:skill-level-advanced' + icon: 'vi-carbon:skill-level-advanced' }, children: [ { @@ -526,7 +526,7 @@ const adminList = [ name: 'Example', meta: { title: 'router.example', - icon: 'ep:management', + icon: 'vi-ep:management', alwaysShow: true }, children: [ @@ -594,7 +594,7 @@ const adminList = [ name: 'Error', meta: { title: 'router.errorPage', - icon: 'ci:error', + icon: 'vi-ci:error', alwaysShow: true }, children: [ @@ -631,7 +631,7 @@ const adminList = [ name: 'Authorization', meta: { title: 'router.authorization', - icon: 'eos-icons:role-binding', + icon: 'vi-eos-icons:role-binding', alwaysShow: true }, children: [ @@ -762,7 +762,7 @@ const menus = [ id: 1, meta: { title: '首页', - icon: 'ant-design:dashboard-filled', + icon: 'vi-ant-design:dashboard-filled', alwaysShow: true }, children: [ @@ -795,7 +795,7 @@ const menus = [ component: '#', meta: { title: '文档', - icon: 'clarity:document-solid' + icon: 'vi-clarity:document-solid' }, name: 'ExternalLink', status: Mock.Random.integer(0, 1), @@ -821,7 +821,7 @@ const menus = [ id: 6, meta: { title: '菜单', - icon: 'carbon:skill-level-advanced' + icon: 'vi-carbon:skill-level-advanced' }, children: [ { @@ -898,7 +898,7 @@ const menus = [ id: 12, meta: { title: '综合示例', - icon: 'ep:management', + icon: 'vi-ep:management', alwaysShow: true }, children: [ @@ -990,7 +990,7 @@ const menus = [ id: 1, meta: { title: '首页', - icon: 'ant-design:dashboard-filled', + icon: 'vi-ant-design:dashboard-filled', alwaysShow: true }, children: [ @@ -1025,7 +1025,7 @@ const menus = [ component: '#', meta: { title: '文档', - icon: 'clarity:document-solid' + icon: 'vi-clarity:document-solid' }, name: 'ExternalLink', status: Mock.Random.integer(0, 1), @@ -1051,7 +1051,7 @@ const menus = [ id: 6, meta: { title: '菜单', - icon: 'carbon:skill-level-advanced' + icon: 'vi-carbon:skill-level-advanced' }, children: [ { @@ -1130,7 +1130,7 @@ const menus = [ id: 12, meta: { title: '综合示例', - icon: 'ep:management', + icon: 'vi-ep:management', alwaysShow: true }, children: [ diff --git a/scripts/icon.ts b/scripts/icon.ts index 27c33e5..724342e 100644 --- a/scripts/icon.ts +++ b/scripts/icon.ts @@ -3,6 +3,7 @@ import fs from 'fs-extra' import inquirer from 'inquirer' import chalk from 'chalk' import pkg from '../package.json' +import { ICON_PREFIX } from '../src/constants' interface Icon { name: string @@ -52,11 +53,12 @@ async function generateIcon() { const data = await fs.readJSON(path.join(dir, 'json', `${info.id}.json`)) if (data) { const { prefix } = data - const icons = Object.keys(data.icons).map((item) => `${prefix}:${item}`) + const prefixName = `${ICON_PREFIX}${prefix}` + const icons = Object.keys(data.icons).map((item) => `${prefixName}:${item}`) await fs.writeFileSync( path.join('src/components/IconPicker/src/data', `icons.${prefix}.ts`), - `export default ${JSON.stringify({ name: info.name, prefix, icons })}` + `export default ${JSON.stringify({ name: info.name, prefix: prefixName, icons })}` ) // ↓分类处理完成,push类型名称 prefixSet.push(prefix) diff --git a/src/components/Collapse/src/Collapse.vue b/src/components/Collapse/src/Collapse.vue index 6d6362e..542d9d3 100644 --- a/src/components/Collapse/src/Collapse.vue +++ b/src/components/Collapse/src/Collapse.vue @@ -26,7 +26,7 @@ const toggleCollapse = () => {
diff --git a/src/components/ContentWrap/src/ContentWrap.vue b/src/components/ContentWrap/src/ContentWrap.vue index 60c9aa9..8557e81 100644 --- a/src/components/ContentWrap/src/ContentWrap.vue +++ b/src/components/ContentWrap/src/ContentWrap.vue @@ -22,7 +22,7 @@ defineProps({ - +
diff --git a/src/components/Descriptions/src/Descriptions.vue b/src/components/Descriptions/src/Descriptions.vue index 3463dbf..2c773b8 100644 --- a/src/components/Descriptions/src/Descriptions.vue +++ b/src/components/Descriptions/src/Descriptions.vue @@ -97,12 +97,14 @@ export default defineComponent({ {props.title} {props.message ? ( - + ) : null}
- {props.collapse ? : null} + {props.collapse ? ( + + ) : null} ) : null} diff --git a/src/components/Dialog/src/Dialog.vue b/src/components/Dialog/src/Dialog.vue index 7bba971..9534db0 100644 --- a/src/components/Dialog/src/Dialog.vue +++ b/src/components/Dialog/src/Dialog.vue @@ -78,14 +78,16 @@ const dialogStyle = computed(() => { { color } }) + +const getIconName = computed(() => { + return props.icon.startsWith(ICON_PREFIX) ? props.icon.replace(ICON_PREFIX, '') : props.icon +}) diff --git a/src/components/SizeDropdown/src/SizeDropdown.vue b/src/components/SizeDropdown/src/SizeDropdown.vue index 1edbf74..eb55917 100644 --- a/src/components/SizeDropdown/src/SizeDropdown.vue +++ b/src/components/SizeDropdown/src/SizeDropdown.vue @@ -27,7 +27,7 @@ const setCurrentSize = (size: ComponentSize) => {