From a5e9361ff1ed2d789d5da3f6d2c39c0b8758fb73 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 17 Oct 2023 13:52:38 +0800 Subject: [PATCH] feat(Menu): Add custom images to menu --- src/api/system/post/index.ts | 4 ++-- src/components/Menu/src/components/MenuItemContent.vue | 4 +++- src/components/SimpleMenu/src/SimpleSubMenu.vue | 5 ++++- src/layouts/default/sider/MixSider.vue | 6 ++++++ src/router/types.ts | 1 + src/types/vue-router.d.ts | 2 ++ 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index 4a89faac..ca1ac00a 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -38,12 +38,12 @@ export function getPost(id: number) { } // 新增岗位 -export function createPost(data: PostVO) { +export function createPost(data) { return defHttp.post({ url: '/system/post/create', data }) } // 修改岗位 -export function updatePost(data: PostVO) { +export function updatePost(data) { return defHttp.put({ url: '/system/post/update', data }) } diff --git a/src/components/Menu/src/components/MenuItemContent.vue b/src/components/Menu/src/components/MenuItemContent.vue index 88f86018..11eed3ee 100644 --- a/src/components/Menu/src/components/MenuItemContent.vue +++ b/src/components/Menu/src/components/MenuItemContent.vue @@ -13,11 +13,13 @@ const { t } = useI18n() const { prefixCls } = useDesign('basic-menu-item-content') const getI18nName = computed(() => t(props.item?.name)) -const getIcon = computed(() => props.item?.icon) +const getIcon = computed(() => (props.item?.img ? undefined : props.item?.icon)) +const getImg = computed(() => props.item?.img)