mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-17 03:32:27 +08:00
fix bug
This commit is contained in:
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,3 +1,15 @@
|
|||||||
|
# 1.5.3 (2021-08-09)
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
- 修复顶部菜单,选中联动
|
||||||
|
- 修复混合菜单模式,切换其他模式菜单未重置
|
||||||
|
- 实例基础列表,和表格组件实例,开启横向滚动特性
|
||||||
|
- `naiveui` 升级成最新版
|
||||||
|
|
||||||
|
- ### ✨ Features
|
||||||
|
- table组件,默认开启 `ellipsis` 特性
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 1.5.2 (2021-08-06)
|
# 1.5.2 (2021-08-06)
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
- 修复已知bug
|
- 修复已知bug
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "naive-ui-admin",
|
"name": "naive-ui-admin",
|
||||||
"version": "1.5.2",
|
"version": "1.5.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Ahjung",
|
"name": "Ahjung",
|
||||||
"email": "735878602@qq.com",
|
"email": "735878602@qq.com",
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
"makeit-captcha": "^1.2.5",
|
"makeit-captcha": "^1.2.5",
|
||||||
"mitt": "^2.1.0",
|
"mitt": "^2.1.0",
|
||||||
"mockjs": "^1.1.0",
|
"mockjs": "^1.1.0",
|
||||||
"naive-ui": "^2.16.1",
|
"naive-ui": "^2.16.2",
|
||||||
"pinia": "^2.0.0-beta.3",
|
"pinia": "^2.0.0-beta.3",
|
||||||
"qs": "^6.10.1",
|
"qs": "^6.10.1",
|
||||||
"vfonts": "^0.1.0",
|
"vfonts": "^0.1.0",
|
||||||
|
|||||||
@@ -278,11 +278,7 @@
|
|||||||
|
|
||||||
function togNavMode(mode) {
|
function togNavMode(mode) {
|
||||||
settingStore.navMode = mode;
|
settingStore.navMode = mode;
|
||||||
// if (mode === 'header-dark') {
|
settingStore.menuSetting.mixMenu = false;
|
||||||
// settingStore.setNavTheme('dark');
|
|
||||||
// } else {
|
|
||||||
// settingStore.setNavTheme('light');
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
import { useAsyncRouteStore } from '@/store/modules/asyncRoute';
|
import { useAsyncRouteStore } from '@/store/modules/asyncRoute';
|
||||||
import { generatorMenu, generatorMenuMix } from '@/utils';
|
import { generatorMenu, generatorMenuMix } from '@/utils';
|
||||||
import { useProjectSettingStore } from '@/store/modules/projectSetting';
|
import { useProjectSettingStore } from '@/store/modules/projectSetting';
|
||||||
|
import { useProjectSetting } from '@/hooks/setting/useProjectSetting';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'Menu',
|
name: 'Menu',
|
||||||
@@ -51,6 +52,10 @@
|
|||||||
const selectedKeys = ref<string>(currentRoute.name as string);
|
const selectedKeys = ref<string>(currentRoute.name as string);
|
||||||
const headerMenuSelectKey = ref<string>('');
|
const headerMenuSelectKey = ref<string>('');
|
||||||
|
|
||||||
|
const { getNavMode } = useProjectSetting();
|
||||||
|
|
||||||
|
const navMode = getNavMode;
|
||||||
|
|
||||||
// 获取当前打开的子菜单
|
// 获取当前打开的子菜单
|
||||||
const matched = currentRoute.matched;
|
const matched = currentRoute.matched;
|
||||||
|
|
||||||
@@ -65,7 +70,10 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const getSelectedKeys = computed(() => {
|
const getSelectedKeys = computed(() => {
|
||||||
return props.location === 'left' ? unref(selectedKeys) : unref(headerMenuSelectKey);
|
let location = props.location;
|
||||||
|
return location === 'left' || (location === 'header' && unref(navMode) === 'horizontal')
|
||||||
|
? unref(selectedKeys)
|
||||||
|
: unref(headerMenuSelectKey);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 监听分割菜单
|
// 监听分割菜单
|
||||||
@@ -96,6 +104,7 @@
|
|||||||
const matched = currentRoute.matched;
|
const matched = currentRoute.matched;
|
||||||
state.openKeys = matched.map((item) => item.name);
|
state.openKeys = matched.map((item) => item.name);
|
||||||
const activeMenu: string = (currentRoute.meta?.activeMenu as string) || '';
|
const activeMenu: string = (currentRoute.meta?.activeMenu as string) || '';
|
||||||
|
console.log(currentRoute);
|
||||||
selectedKeys.value = activeMenu ? (activeMenu as string) : (currentRoute.name as string);
|
selectedKeys.value = activeMenu ? (activeMenu as string) : (currentRoute.name as string);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export function generatorMenuMix(routerMap: Array<any>, routerName: string, loca
|
|||||||
* 递归组装子菜单
|
* 递归组装子菜单
|
||||||
* */
|
* */
|
||||||
export function getChildrenRouter(routerMap: Array<any>) {
|
export function getChildrenRouter(routerMap: Array<any>) {
|
||||||
return routerMap.map((item) => {
|
return filterRouter(routerMap).map((item) => {
|
||||||
const isRoot = isRootRouter(item);
|
const isRoot = isRootRouter(item);
|
||||||
const info = isRoot ? item.children[0] : item;
|
const info = isRoot ? item.children[0] : item;
|
||||||
const currentMenu = {
|
const currentMenu = {
|
||||||
|
|||||||
@@ -77,6 +77,6 @@ export const columns = [
|
|||||||
{
|
{
|
||||||
title: '停留时间',
|
title: '停留时间',
|
||||||
key: 'time',
|
key: 'time',
|
||||||
width: 160,
|
width: 80,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -67,6 +67,6 @@ export const columns = [
|
|||||||
{
|
{
|
||||||
title: '停留时间',
|
title: '停留时间',
|
||||||
key: 'time',
|
key: 'time',
|
||||||
width: 160,
|
width: 80,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
@edit-end="editEnd"
|
@edit-end="editEnd"
|
||||||
@edit-change="onEditChange"
|
@edit-change="onEditChange"
|
||||||
@update:checked-row-keys="onCheckedRow"
|
@update:checked-row-keys="onCheckedRow"
|
||||||
:scroll-x="1300"
|
:scroll-x="1360"
|
||||||
>
|
>
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<n-button type="primary" @click="reloadTable">刷新数据</n-button>
|
<n-button type="primary" @click="reloadTable">刷新数据</n-button>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
@edit-end="editEnd"
|
@edit-end="editEnd"
|
||||||
@edit-change="onEditChange"
|
@edit-change="onEditChange"
|
||||||
@update:checked-row-keys="onCheckedRow"
|
@update:checked-row-keys="onCheckedRow"
|
||||||
:scroll-x="1530"
|
:scroll-x="1510"
|
||||||
>
|
>
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<n-button type="primary" @click="reloadTable">刷新数据</n-button>
|
<n-button type="primary" @click="reloadTable">刷新数据</n-button>
|
||||||
|
|||||||
@@ -91,6 +91,6 @@ export const columns = [
|
|||||||
{
|
{
|
||||||
title: '停留时间',
|
title: '停留时间',
|
||||||
key: 'time',
|
key: 'time',
|
||||||
width: 160,
|
width: 80,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -33,14 +33,7 @@
|
|||||||
</n-grid>
|
</n-grid>
|
||||||
</n-card>
|
</n-card>
|
||||||
</div>
|
</div>
|
||||||
<n-grid
|
<n-grid class="mt-4" cols="2 s:1 m:1 l:2 xl:2 2xl:2" responsive="screen" :x-gap="12" :y-gap="9">
|
||||||
class="mt-4"
|
|
||||||
cols="2 s:1 m:1 l:2 xl:2 2xl:2"
|
|
||||||
responsive="screen"
|
|
||||||
:x-gap="12"
|
|
||||||
:y-gap="9"
|
|
||||||
:cols="2"
|
|
||||||
>
|
|
||||||
<n-gi>
|
<n-gi>
|
||||||
<n-card
|
<n-card
|
||||||
:segmented="{ content: 'hard' }"
|
:segmented="{ content: 'hard' }"
|
||||||
@@ -75,7 +68,7 @@
|
|||||||
>
|
>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<span>
|
<span>
|
||||||
<n-icon size="30" style="color: #42b983">
|
<n-icon size="30" color="#42b983">
|
||||||
<LogoVue />
|
<LogoVue />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -91,7 +84,7 @@
|
|||||||
>
|
>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<span>
|
<span>
|
||||||
<n-icon size="30" style="color: #e44c27">
|
<n-icon size="30" color="#e44c27">
|
||||||
<Html5Outlined />
|
<Html5Outlined />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -107,7 +100,7 @@
|
|||||||
>
|
>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<span>
|
<span>
|
||||||
<n-icon size="30" style="color: #dd0031">
|
<n-icon size="30" color="#dd0031">
|
||||||
<LogoAngular />
|
<LogoAngular />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -123,7 +116,7 @@
|
|||||||
>
|
>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<span>
|
<span>
|
||||||
<n-icon size="30" style="color: #61dafb">
|
<n-icon size="30" color="#61dafb">
|
||||||
<LogoReact />
|
<LogoReact />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -238,7 +231,7 @@
|
|||||||
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
||||||
<div class="flex flex-col justify-center text-gray-500">
|
<div class="flex flex-col justify-center text-gray-500">
|
||||||
<span class="text-center">
|
<span class="text-center">
|
||||||
<n-icon size="30" style="color: #68c755">
|
<n-icon size="30" color="#68c755">
|
||||||
<DashboardOutlined />
|
<DashboardOutlined />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -248,7 +241,7 @@
|
|||||||
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
||||||
<div class="flex flex-col justify-center text-gray-500">
|
<div class="flex flex-col justify-center text-gray-500">
|
||||||
<span class="text-center">
|
<span class="text-center">
|
||||||
<n-icon size="30" style="color: #fab251">
|
<n-icon size="30" color="#fab251">
|
||||||
<ProfileOutlined />
|
<ProfileOutlined />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -258,7 +251,7 @@
|
|||||||
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
||||||
<div class="flex flex-col justify-center text-gray-500">
|
<div class="flex flex-col justify-center text-gray-500">
|
||||||
<span class="text-center">
|
<span class="text-center">
|
||||||
<n-icon size="30" style="color: #1890ff">
|
<n-icon size="30" color="#1890ff">
|
||||||
<FileProtectOutlined />
|
<FileProtectOutlined />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -268,7 +261,7 @@
|
|||||||
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
||||||
<div class="flex flex-col justify-center text-gray-500">
|
<div class="flex flex-col justify-center text-gray-500">
|
||||||
<span class="text-center">
|
<span class="text-center">
|
||||||
<n-icon size="30" style="color: #f06b96">
|
<n-icon size="30" color="#f06b96">
|
||||||
<ApartmentOutlined />
|
<ApartmentOutlined />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -278,7 +271,7 @@
|
|||||||
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
|
||||||
<div class="flex flex-col justify-center text-gray-500">
|
<div class="flex flex-col justify-center text-gray-500">
|
||||||
<span class="text-center">
|
<span class="text-center">
|
||||||
<n-icon size="30" style="color: #7238d1">
|
<n-icon size="30" color="#7238d1">
|
||||||
<SettingOutlined />
|
<SettingOutlined />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
ref="actionRef"
|
ref="actionRef"
|
||||||
:actionColumn="actionColumn"
|
:actionColumn="actionColumn"
|
||||||
@update:checked-row-keys="onCheckedRow"
|
@update:checked-row-keys="onCheckedRow"
|
||||||
:scroll-x="1090"
|
:scroll-x="1010"
|
||||||
>
|
>
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<n-button type="primary" @click="addTable">
|
<n-button type="primary" @click="addTable">
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
name: 'xiaoMa',
|
name: 'xiaoMa',
|
||||||
},
|
},
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
width: 220,
|
width: 140,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
|||||||
@@ -4999,10 +4999,10 @@ mute-stream@0.0.7:
|
|||||||
resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
|
resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
|
||||||
integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=
|
integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=
|
||||||
|
|
||||||
naive-ui@^2.16.1:
|
naive-ui@^2.16.2:
|
||||||
version "2.16.1"
|
version "2.16.2"
|
||||||
resolved "https://registry.yarnpkg.com/naive-ui/-/naive-ui-2.16.1.tgz#0599e6748f498ad8f4f2f4c6c0637c1f1d860827"
|
resolved "https://registry.nlark.com/naive-ui/download/naive-ui-2.16.2.tgz#f7d4b84f15529bc8f367644edcdb2c14c7912372"
|
||||||
integrity sha512-ku7ZxxBMp2fHD2eKV1gUDO6LmvMPUKYx0JzgtiCHRC8B88t4Ch5Momf+CfuYIM5NeVexzcmlahadslB74Bgbfw==
|
integrity sha1-99S4TxVSm8jzZ2RO3NssFMeRI3I=
|
||||||
dependencies:
|
dependencies:
|
||||||
"@css-render/plugin-bem" "^0.15.4"
|
"@css-render/plugin-bem" "^0.15.4"
|
||||||
"@css-render/vue3-ssr" "^0.15.4"
|
"@css-render/vue3-ssr" "^0.15.4"
|
||||||
|
|||||||
Reference in New Issue
Block a user