29 lines
785 B
TypeScript
29 lines
785 B
TypeScript
import type { MultiTabsSetting } from '/@/types/config';
|
|
|
|
import { computed, unref } from 'vue';
|
|
|
|
import { appStore } from '/@/store/modules/app';
|
|
|
|
export function useMultipleTabSetting() {
|
|
const getMultipleTabSetting = computed(() => appStore.getProjectConfig.multiTabsSetting);
|
|
|
|
const getMax = computed(() => unref(getMultipleTabSetting).max);
|
|
|
|
const getShowMultipleTab = computed(() => unref(getMultipleTabSetting).show);
|
|
|
|
const getShowQuick = computed(() => unref(getMultipleTabSetting).showQuick);
|
|
|
|
function setMultipleTabSetting(multiTabsSetting: Partial<MultiTabsSetting>) {
|
|
appStore.commitProjectConfigState({ multiTabsSetting });
|
|
}
|
|
|
|
return {
|
|
setMultipleTabSetting,
|
|
|
|
getMultipleTabSetting,
|
|
getMax,
|
|
getShowMultipleTab,
|
|
getShowQuick,
|
|
};
|
|
}
|