1
0
Эх сурвалжийг харах

fix(cropper): cropper not destroy in time

图片剪裁组件未能及时销毁资源

fixed: #1027
无木 3 жил өмнө
parent
commit
381943078f

+ 6 - 0
CHANGELOG.zh_CN.md

@@ -1,3 +1,9 @@
+### 🐛 Bug Fixes
+
+- **Cropper** 修复未能及时销毁的问题
+- **BasicTable** 修复`CellFormat`无法使用`Map`类型数据的问题
+- **Qrcode** 修复二维码组件在创建时未能及时绘制的问题
+
 ## 2.7.0(2021-08-03)
 
 ## (破坏性更新) Breaking changes

+ 5 - 1
src/components/Cropper/src/Cropper.vue

@@ -12,7 +12,7 @@
 </template>
 <script lang="ts">
   import type { CSSProperties } from 'vue';
-  import { defineComponent, onMounted, ref, unref, computed } from 'vue';
+  import { defineComponent, onMounted, ref, unref, computed, onUnmounted } from 'vue';
   import Cropper from 'cropperjs';
   import 'cropperjs/dist/cropper.css';
   import { useDesign } from '/@/hooks/web/useDesign';
@@ -93,6 +93,10 @@
 
       onMounted(init);
 
+      onUnmounted(() => {
+        cropper.value?.destroy();
+      });
+
       async function init() {
         const imgEl = unref(imgElRef);
         if (!imgEl) {