fix(cropper): cropper not destroy in time

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

fixed: #1027
This commit is contained in:
无木 2021-08-03 21:17:38 +08:00
parent 26f251e1ed
commit 381943078f
2 changed files with 11 additions and 1 deletions

View File

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

View File

@ -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) {