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