mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
【同步3.7.4版本代码】新增全局布局隐藏配置,优化多个组件的属性和逻辑
This commit is contained in:
@ -2,12 +2,14 @@ import type { App } from 'vue';
|
||||
import type { Pinia } from 'pinia';
|
||||
import { createPinia } from 'pinia';
|
||||
|
||||
let app: Nullable<App<Element>> = null;
|
||||
let store: Nullable<Pinia> = null;
|
||||
|
||||
export function setupStore(app: App<Element>) {
|
||||
export function setupStore($app: App<Element>) {
|
||||
if (store == null) {
|
||||
store = createPinia();
|
||||
}
|
||||
app = $app;
|
||||
app.use(store);
|
||||
}
|
||||
|
||||
@ -16,4 +18,7 @@ export function destroyStore() {
|
||||
store = null;
|
||||
}
|
||||
|
||||
export { store };
|
||||
// 获取app实例
|
||||
export const getAppContext = () => app?._context;
|
||||
|
||||
export {app, store};
|
||||
|
||||
@ -11,6 +11,7 @@ import { Persistent } from '/@/utils/cache/persistent';
|
||||
import { darkMode } from '/@/settings/designSetting';
|
||||
import { resetRouter } from '/@/router';
|
||||
import { deepMerge } from '/@/utils';
|
||||
import { getHideLayoutTypes } from '/@/utils/env';
|
||||
|
||||
interface AppState {
|
||||
darkMode?: ThemeEnum;
|
||||
@ -70,6 +71,28 @@ export const useAppStore = defineStore({
|
||||
getMainAppProps(): MainAppProps {
|
||||
return this.mainAppProps;
|
||||
},
|
||||
|
||||
getLayoutHideSider(): boolean {
|
||||
const hideLayoutTypes = getHideLayoutTypes();
|
||||
if (hideLayoutTypes.includes('sider')) {
|
||||
return true;
|
||||
}
|
||||
return !!this.mainAppProps.hideSider;
|
||||
},
|
||||
getLayoutHideHeader(): boolean {
|
||||
const hideLayoutTypes = getHideLayoutTypes();
|
||||
if (hideLayoutTypes.includes('header')) {
|
||||
return true;
|
||||
}
|
||||
return !!this.mainAppProps.hideHeader;
|
||||
},
|
||||
getLayoutHideMultiTabs(): boolean {
|
||||
const hideLayoutTypes = getHideLayoutTypes();
|
||||
if (hideLayoutTypes.includes('multi-tabs')) {
|
||||
return true;
|
||||
}
|
||||
return !!this.mainAppProps.hideMultiTabs;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setPageLoading(loading: boolean): void {
|
||||
|
||||
Reference in New Issue
Block a user