Skip to content

Commit

Permalink
fix(cropper): cropper not destroy in time
Browse files Browse the repository at this point in the history
图片剪裁组件未能及时销毁资源

fixed: #1027
  • Loading branch information
mynetfan committed Aug 3, 2021
1 parent 26f251e commit 3819430
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 🐛 Bug Fixes

- **Cropper** 修复未能及时销毁的问题
- **BasicTable** 修复`CellFormat`无法使用`Map`类型数据的问题
- **Qrcode** 修复二维码组件在创建时未能及时绘制的问题

## 2.7.0(2021-08-03)

## (破坏性更新) Breaking changes
Expand Down
6 changes: 5 additions & 1 deletion src/components/Cropper/src/Cropper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -93,6 +93,10 @@
onMounted(init);
onUnmounted(() => {
cropper.value?.destroy();
});
async function init() {
const imgEl = unref(imgElRef);
if (!imgEl) {
Expand Down

0 comments on commit 3819430

Please sign in to comment.