import useUserStore from "@/store/modules/user";
import defaultSettings from '@/settings'
import useSettingsStore from '@/store/modules/settings'
/**
 * 动态修改标题
 */
export function useDynamicTitle(title) {
    const settingsStore = useSettingsStore();
    if (title) {
        document.title = title;
    } else {
        if (settingsStore.dynamicTitle) {
            // document.title = settingsStore.title + ' - ' + defaultSettings.title;
            document.title = settingsStore.title + ' - ' + useUserStore().middlePageData.page.middleTitle
        } else {
            document.title = defaultSettings.title;
        }
    }

}