Skip to content

Commit 4034bc6

Browse files
committed
Fix: 修复全屏失效
1 parent 844490b commit 4034bc6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

package/components/NanoContainer/index.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div
33
ref="container"
44
class="nano-theme absolute"
5-
:style="{ ...containerLayout, ...animation }"
5+
:style="{ ...containerLayoutStyle, ...animation }"
66
>
77
<div v-show="!loading" class="relative w-full h-full flex flex-col">
88
<NanoHeader ref="header" @dblclick.self="ctl.fullscreen = !ctl.fullscreen"/>
@@ -50,6 +50,15 @@
5050
5151
const containerLayout = ref<LayoutBaseInfo>(layout.containerLayout);
5252
53+
const containerLayoutStyle = computed(() => {
54+
return !ctl.onlyFullscreen && !ctl.fullscreen ? containerLayout.value : {
55+
top: 0,
56+
left: 0,
57+
width: '100vw',
58+
height: '100vh'
59+
};
60+
});
61+
5362
watch(containerLayout, debounce((val) => {
5463
// console.log('containerLayout changed', val);
5564
layout.setContainerLayout(val);

package/store/contentLayout.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { defineStore } from 'pinia';
22
import { merge } from 'lodash-es';
3-
import { controllerStore } from '@store/controller';
43

54
export type LayoutBaseInfo = {
65
top?: string | number;
@@ -37,15 +36,7 @@ export const contentLayoutStore = defineStore('contentLayout', {
3736
}),
3837
getters: {
3938
containerLayout: (state): LayoutBaseInfo => {
40-
const ctl = controllerStore();
41-
return !ctl.onlyFullscreen && !ctl.fullscreen ?
42-
merge({}, state.container.default, state.container.changed) :
43-
{
44-
top: 0,
45-
left: 0,
46-
width: '100vw',
47-
height: '100vh'
48-
};
39+
return merge({}, state.container.default, state.container.changed);
4940
},
5041
leftSidebarLayout: (state) => {
5142
return merge({}, state.leftSidebar.default, state.leftSidebar.changed);

0 commit comments

Comments
 (0)