Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
chore: 调整使用新的renderIcon函数
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmao88 committed Oct 31, 2023
1 parent 46f7fbf commit 1bb7060
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
3 changes: 1 addition & 2 deletions packages/layouts/src/components/breadcrumb/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { useI18n } from '@vben/locale'
import { useGo } from '@vben/hooks'
import { filterTree, isString } from '@vben/utils'
import { REDIRECT_NAME } from '@vben/constants'
import { VbenIconify } from '@vben/vbencomponents'
import { VbenIconify, renderIcon } from '@vben/vbencomponents'
import { Menu } from '@vben/types'
import { renderIcon } from '../index'
import { getMenus, getAllParentPath } from '@vben/router'
import { context } from '../../../bridge'
Expand Down
7 changes: 0 additions & 7 deletions packages/layouts/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
import { h } from 'vue'
import { VbenIconify } from '@vben/vbencomponents'

export const renderIcon = (icon: string) => {
if (!icon) return undefined
return () => h(VbenIconify, { icon })
}
2 changes: 1 addition & 1 deletion packages/layouts/src/components/menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from 'vue-router'
import { useI18n } from '@vben/locale'
import { REDIRECT_NAME } from '@vben/constants'
import { renderIcon } from '../index'
import { renderIcon } from '@vben/vbencomponents'
import { context } from '../../../bridge'
import type { RouteMeta } from 'vue-router'
Expand Down
9 changes: 4 additions & 5 deletions packages/layouts/src/components/menu/mix-sub-menu.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import {ref, h, unref, nextTick, computed} from 'vue'
import { ref, h, unref, nextTick, computed } from 'vue'
import { createNamespace, mapTree } from '@vben/utils'
import { context } from '../../../bridge'
import {
Expand All @@ -9,14 +9,13 @@ import {
} from 'vue-router'
import { useI18n } from '@vben/locale'
import { REDIRECT_NAME } from '@vben/constants'
import {renderIcon} from "../index";
import { renderIcon } from '@vben/vbencomponents'
const { listenerRouteChange, useMenuSetting } = context
const { getAccordion } = useMenuSetting()
const props = defineProps({
list: {
type: Array,
default: ()=>[],
default: () => [],
},
})
const { bem } = createNamespace('layout-menu')
Expand All @@ -33,7 +32,7 @@ const showOption = () => {
})
}
const menuList = computed(()=>{
const menuList = computed(() => {
return mapTree(props.list, { conversion: (menu) => routerToMenu(menu) })
})
Expand Down
2 changes: 1 addition & 1 deletion packages/layouts/src/components/user-dropdown/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ref, unref } from 'vue'
import { useI18n } from '@vben/locale'
import LockModal from '../lock/LockModal.vue'
import { renderIcon } from '../../components'
import { renderIcon } from '@vben/vbencomponents'
import { context } from '../../../bridge'
const { useUserStore } = context
Expand Down

0 comments on commit 1bb7060

Please sign in to comment.