Commit 381943078fd55123fde3d5555e04f279d7f1c407

Authored by 无木
1 parent 26f251e1

fix(cropper): cropper not destroy in time

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

fixed: #1027
CHANGELOG.zh_CN.md
  1 +### 🐛 Bug Fixes
  2 +
  3 +- **Cropper** 修复未能及时销毁的问题
  4 +- **BasicTable** 修复`CellFormat`无法使用`Map`类型数据的问题
  5 +- **Qrcode** 修复二维码组件在创建时未能及时绘制的问题
  6 +
1 7 ## 2.7.0(2021-08-03)
2 8  
3 9 ## (破坏性更新) Breaking changes
... ...
src/components/Cropper/src/Cropper.vue
... ... @@ -12,7 +12,7 @@
12 12 </template>
13 13 <script lang="ts">
14 14 import type { CSSProperties } from 'vue';
15   - import { defineComponent, onMounted, ref, unref, computed } from 'vue';
  15 + import { defineComponent, onMounted, ref, unref, computed, onUnmounted } from 'vue';
16 16 import Cropper from 'cropperjs';
17 17 import 'cropperjs/dist/cropper.css';
18 18 import { useDesign } from '/@/hooks/web/useDesign';
... ... @@ -93,6 +93,10 @@
93 93  
94 94 onMounted(init);
95 95  
  96 + onUnmounted(() => {
  97 + cropper.value?.destroy();
  98 + });
  99 +
96 100 async function init() {
97 101 const imgEl = unref(imgElRef);
98 102 if (!imgEl) {
... ...