Browse Source

设置组件背景问题修改

dsy 1 ngày trước cách đây
mục cha
commit
2499fd3463

+ 2 - 2
src/views/book/courseware/create/components/SetComponentBackground.vue

@@ -142,7 +142,7 @@
 import { fileUpload } from '@/api/app';
 
 export default {
-  name: 'SetBackground',
+  name: 'SetComponentBackground',
   props: {
     visible: {
       type: Boolean,
@@ -254,6 +254,7 @@ export default {
     visible(newVal) {
       if (!newVal) {
         this.revertData();
+        return;
       }
 
       const component = document.querySelector(`div.${this.componentData.component_id}`);
@@ -302,7 +303,6 @@ export default {
      * 还原数据
      */
     revertData() {
-      document.querySelector('.background-img')?.removeEventListener('mousemove', this.mouseMove);
       this.cropMode = false;
       this.resetCropRect();
       this.maxWidth = 500;