lsc 6 months ago
parent
commit
54f4d1db3e
1 changed files with 10 additions and 8 deletions
  1. 10 8
      src/components/classRoomHelper/component/workFlowIframe.vue

+ 10 - 8
src/components/classRoomHelper/component/workFlowIframe.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="ibox">
-    <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;" webkitallowfullscreen mozallowfullscreen allowfullscreen :src="src" frameborder="0" style="width: 100%; height: calc(100% - 30px)"></iframe>
+    <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;" webkitallowfullscreen mozallowfullscreen allowfullscreen :src="src" frameborder="0" style="width: 100%;" :style="{height: iframeSrc.length > 1 ? 'calc(100% - 30px)' : '100%'}"></iframe>
     <div v-if='iframeSrc.length > 1' class="ibox-tools">
         <span class="tool" v-for="(item, index) in iframeSrc" :key="index" @click="setSrc(index)" :class="{active: index == checkIndex}">
             {{ item.name }}
@@ -19,13 +19,15 @@ export default {
     },
     watch: {
         iframeSrc: {
-        handler: function(newVal, oldVal) {
-            if (newVal) {
-                this.checkIndex = 0
-                this.src = newVal[this.checkIndex].src
-            }
-        },
-        deep: true
+            handler: function(newVal, oldVal) {
+                if (newVal) {
+                    this.checkIndex = 0
+                    this.src = newVal[this.checkIndex].src
+                    console.log('-------------------',this.src);
+                    this.$forceUpdate();
+                }
+            },
+            deep: true
         }
     },
     data() {