Przeglądaj źródła

Merge branch 'beta' of https://git.cocorobo.cn/jack/PPT into beta

jack 3 tygodni temu
rodzic
commit
ea62ca52a6
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      src/views/Student/index.vue

+ 4 - 4
src/views/Student/index.vue

@@ -1898,7 +1898,7 @@ const handleHomeworkSubmit = async () => {
             })
 
             iframeBody = iframeElement.contentWindow.document.body as HTMLElement
-            iframehtml = iframeElement.contentWindow.document.getElementsByTagName("html")[0] as HTMLElement
+            iframehtml = iframeElement.contentWindow.document.getElementsByTagName('html')[0] as HTMLElement
           }
           else {
             message.error(lang.ssFailedGetIframeBody)
@@ -1908,7 +1908,7 @@ const handleHomeworkSubmit = async () => {
           try {
             const a = iframeBody.getElementsByTagName('img')
             const b = iframeBody.getElementsByTagName('video')
-            //const c = iframeBody.getElementsByTagName('canvas')
+            // const c = iframeBody.getElementsByTagName('canvas')
             iframeBody.style.cssText += 'width:100%;height:100%;position:absolute;top:0;left:0;'
             iframehtml.style.cssText += 'width:100%;height:100%;position:absolute;top:0;left:0;'
             for (let i = 0;i < a.length;i++) {
@@ -2096,8 +2096,8 @@ const handleHomeworkSubmit = async () => {
             iframeElement.contentWindow.document &&
             iframeElement.contentWindow.document.body
         ) {
-          iframeElement.contentWindow.document.body.style.width = '100vw'
-          iframeElement.contentWindow.document.body.style.height = '100vh'
+          iframeElement.contentWindow.document.body.style.cssText += 'width:100%;height:100%;position:absolute;top:0;left:0;'
+          iframeElement.contentWindow.document.getElementsByTagName('html')[0].style.cssText += 'width:100%;height:100%;position:absolute;top:0;left:0;'
           try {
             isSubmitting.value = true