Selaa lähdekoodia

修改课程详情图片宽度问题

11wqe1 1 vuosi sitten
vanhempi
commit
1f315e3f08
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 7 4
      src/views/course/components/courseTitle.vue

+ 7 - 4
src/views/course/components/courseTitle.vue

@@ -36,12 +36,15 @@ export default {
   data() {
     return {}
   },
+  watch: {
+    chapInfo(newVal, oldVal) {
+      this.chapInfo.chapterInfo[0].taskJson[this.taskCount].taskDetail = this.chapInfo.chapterInfo[0].taskJson[
+        this.taskCount
+      ].taskDetail.replace(/(<img[^>]+)style="max-width:\s*100%25;"/g, '$1style="max-width:100%;"')
+    }
+  },
   mounted() {
     // let con = this.chapInfo
-    console.log('??????????????????????????????', this.chapInfo)
-    this.chapInfo.chapterInfo[0].taskJson[this.taskCount].taskDetail = this.chapInfo.chapterInfo[0].taskJson[
-      this.taskCount
-    ].taskDetail.replace(/(<img[^>]+)style="max-width:\s*100%25;"/g, '$1style="max-width:100%;"')
   }
 }
 </script>