refactor(project): re-adjust the overall folder
This commit is contained in:
24
packages/effects/hooks/src/use-content-maximize.ts
Normal file
24
packages/effects/hooks/src/use-content-maximize.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { updatePreferences, usePreferences } from '@vben/preferences';
|
||||
/**
|
||||
* 主体区域最大化
|
||||
*/
|
||||
export function useContentMaximize() {
|
||||
const { contentIsMaximize } = usePreferences();
|
||||
|
||||
function toggleMaximize() {
|
||||
const isMaximize = contentIsMaximize.value;
|
||||
|
||||
updatePreferences({
|
||||
header: {
|
||||
hidden: !isMaximize,
|
||||
},
|
||||
sidebar: {
|
||||
hidden: !isMaximize,
|
||||
},
|
||||
});
|
||||
}
|
||||
return {
|
||||
contentIsMaximize,
|
||||
toggleMaximize,
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user