fix: 修复菜单本地图标显示问题
This commit is contained in:
parent
e6ac3797b9
commit
3356928138
@ -38,9 +38,9 @@ async function getMenuList() {
|
||||
getMenuList();
|
||||
|
||||
function renderPrefix({ option }: { option: TreeOption }) {
|
||||
const renderLocalIcon = String(option.icon).startsWith('icon-');
|
||||
const renderLocalIcon = String(option.icon).startsWith('local-icon-');
|
||||
const icon = renderLocalIcon ? undefined : String(option.icon);
|
||||
const localIcon = renderLocalIcon ? String(option.icon).replace('icon-', 'menu-') : undefined;
|
||||
const localIcon = renderLocalIcon ? String(option.icon).replace('local-icon-', 'menu-') : undefined;
|
||||
return <SvgIcon icon={icon} localIcon={localIcon} />;
|
||||
}
|
||||
</script>
|
||||
|
@ -61,9 +61,9 @@ watch([expandAll, options], ([newVal]) => {
|
||||
});
|
||||
|
||||
function renderPrefix({ option }: { option: TreeOption }) {
|
||||
const renderLocalIcon = String(option.icon).startsWith('icon-');
|
||||
const renderLocalIcon = String(option.icon).startsWith('local-icon-');
|
||||
let icon = renderLocalIcon ? undefined : String(option.icon ?? 'material-symbols:buttons-alt-outline-rounded');
|
||||
const localIcon = renderLocalIcon ? String(option.icon).replace('icon-', 'menu-') : undefined;
|
||||
const localIcon = renderLocalIcon ? String(option.icon).replace('local-icon-', 'menu-') : undefined;
|
||||
if (icon === '#') {
|
||||
icon = 'material-symbols:buttons-alt-outline-rounded';
|
||||
}
|
||||
|
@ -93,9 +93,9 @@ async function handleDeleteMenu(id?: CommonType.IdType) {
|
||||
}
|
||||
|
||||
function renderPrefix({ option }: { option: TreeOption }) {
|
||||
const renderLocalIcon = String(option.icon).startsWith('icon-');
|
||||
const renderLocalIcon = String(option.icon).startsWith('local-icon-');
|
||||
const icon = renderLocalIcon ? undefined : String(option.icon);
|
||||
const localIcon = renderLocalIcon ? String(option.icon).replace('icon-', 'menu-') : undefined;
|
||||
const localIcon = renderLocalIcon ? String(option.icon).replace('local-icon-', 'menu-') : undefined;
|
||||
return <SvgIcon icon={icon} localIcon={localIcon} />;
|
||||
}
|
||||
|
||||
|
@ -122,12 +122,12 @@ async function handleSubmit() {
|
||||
menuId,
|
||||
parentId,
|
||||
menuName,
|
||||
icon,
|
||||
orderNum,
|
||||
queryParam,
|
||||
isFrame,
|
||||
isCache,
|
||||
menuType,
|
||||
icon,
|
||||
visible: menuVisible,
|
||||
status,
|
||||
perms,
|
||||
@ -264,7 +264,7 @@ function onCreate() {
|
||||
</NInput>
|
||||
</template>
|
||||
<template v-if="iconType === '2'">
|
||||
<NSelect v-model:value="model.icon" placeholder="请选择本地图标" :options="localIconOptions" />
|
||||
<NSelect v-model:value="model.icon" placeholder="请选择本地图标" filterable :options="localIconOptions" />
|
||||
</template>
|
||||
</NFormItemGi>
|
||||
<NFormItemGi v-if="!isBtn" :span="24" path="path">
|
||||
|
@ -123,6 +123,8 @@ const {
|
||||
align: 'center',
|
||||
width: 150,
|
||||
render: row => {
|
||||
if (row.userId === 1) return null;
|
||||
|
||||
const editBtn = () => {
|
||||
return (
|
||||
<ButtonIcon
|
||||
|
Loading…
Reference in New Issue
Block a user