useMultipleTabSetting.ts 818 B

12345678910111213141516171819202122232425262728
  1. import type { MultiTabsSetting } from '/#/config';
  2. import { computed } from 'vue';
  3. import { useAppStore } from '/@/store/modules/app';
  4. export function useMultipleTabSetting() {
  5. const appStore = useAppStore();
  6. const getShowMultipleTab = computed(() => appStore.getMultiTabsSetting.show);
  7. const getShowQuick = computed(() => appStore.getMultiTabsSetting.showQuick);
  8. const getShowRedo = computed(() => appStore.getMultiTabsSetting.showRedo);
  9. const getShowFold = computed(() => appStore.getMultiTabsSetting.showFold);
  10. function setMultipleTabSetting(multiTabsSetting: Partial<MultiTabsSetting>) {
  11. appStore.setProjectConfig({ multiTabsSetting });
  12. }
  13. return {
  14. setMultipleTabSetting,
  15. getShowMultipleTab,
  16. getShowQuick,
  17. getShowRedo,
  18. getShowFold,
  19. };
  20. }