mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-06 00:18:51 +08:00
feat: 添加全局配置MaxTagsLevel
属性,可设置打开标签页最大数
This commit is contained in:
parent
abd042afe8
commit
d1d2bcaa11
@ -4,7 +4,9 @@ import {
|
|||||||
store,
|
store,
|
||||||
isUrl,
|
isUrl,
|
||||||
isEqual,
|
isEqual,
|
||||||
|
isNumber,
|
||||||
isBoolean,
|
isBoolean,
|
||||||
|
getConfig,
|
||||||
defineStore,
|
defineStore,
|
||||||
routerArrays,
|
routerArrays,
|
||||||
storageLocal,
|
storageLocal,
|
||||||
@ -112,6 +114,14 @@ export const useMultiTagsStore = defineStore({
|
|||||||
}
|
}
|
||||||
this.multiTags.push(value);
|
this.multiTags.push(value);
|
||||||
this.tagsCache(this.multiTags);
|
this.tagsCache(this.multiTags);
|
||||||
|
if (
|
||||||
|
getConfig()?.MaxTagsLevel &&
|
||||||
|
isNumber(getConfig().MaxTagsLevel)
|
||||||
|
) {
|
||||||
|
if (this.multiTags.length > getConfig().MaxTagsLevel) {
|
||||||
|
this.multiTags.splice(1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "splice":
|
case "splice":
|
||||||
|
@ -12,6 +12,7 @@ export {
|
|||||||
export {
|
export {
|
||||||
isUrl,
|
isUrl,
|
||||||
isEqual,
|
isEqual,
|
||||||
|
isNumber,
|
||||||
debounce,
|
debounce,
|
||||||
isBoolean,
|
isBoolean,
|
||||||
getKeyList,
|
getKeyList,
|
||||||
|
1
types/global.d.ts
vendored
1
types/global.d.ts
vendored
@ -87,6 +87,7 @@ declare global {
|
|||||||
FixedHeader?: boolean;
|
FixedHeader?: boolean;
|
||||||
HiddenSideBar?: boolean;
|
HiddenSideBar?: boolean;
|
||||||
MultiTagsCache?: boolean;
|
MultiTagsCache?: boolean;
|
||||||
|
MaxTagsLevel?: number;
|
||||||
KeepAlive?: boolean;
|
KeepAlive?: boolean;
|
||||||
Locale?: string;
|
Locale?: string;
|
||||||
Layout?: string;
|
Layout?: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user