Преглед на файлове

书法大师解决剪裁外部调,

qinpeng преди 2 години
родител
ревизия
a61afeaa78
променени са 1 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 10 1
      src/views/CalligraphyMaster/cread.vue

+ 10 - 1
src/views/CalligraphyMaster/cread.vue

@@ -213,7 +213,7 @@
           ></div>
         </div>
         <div class="bottom">
-          <div>
+          <div @click="changeSize">
             <img src="../../assets/teacherdev/sfds-tailoring.png" alt="" />
           </div>
           <el-upload
@@ -523,6 +523,7 @@ export default {
       imgCtx: null,
       TUI_selectedItem: null,
       TUI_selectedFont: "",
+      instance: null,
     };
   },
   //计算属性 类似于data概念
@@ -600,6 +601,14 @@ export default {
         return Math.abs(Math.abs(this.luminanceNumber) - 100) / 100;
       }
     },
+    // 裁剪
+    changeSize() {
+      if (!this.instance) {
+        this.$message.warning("请先上传图片");
+        return;
+      }
+      this.instance.ui._actions.crop.cancel();
+    },
     initCanvasImage() {
       this.loading = this.$loading({
         lock: true,