Explorar el Código

优化tag全屏为页签内区域

RuoYi hace 2 meses
padre
commit
a2f1bf6372
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      src/layout/components/TagsView/index.vue

+ 9 - 1
src/layout/components/TagsView/index.vue

@@ -258,7 +258,10 @@ function updateArrowState() {
 
 function toggleFullscreen() {
   if (!document.fullscreenElement) {
-    document.documentElement.requestFullscreen()
+    const appMain = document.querySelector('.app-main')
+    if (appMain) {
+      appMain.requestFullscreen()
+    }
   } else {
     document.exitFullscreen()
   }
@@ -266,6 +269,11 @@ function toggleFullscreen() {
 
 function onFullscreenChange() {
   isFullscreen.value = !!document.fullscreenElement
+  const appMain = document.querySelector('.app-main')
+  if (appMain) {
+    appMain.style.backgroundColor = document.fullscreenElement ? '#fff' : ''
+    appMain.style.overflowY = document.fullscreenElement ? 'auto' : ''
+  }
 }
 
 function handleDropdownCommand(command) {