提交 38194307 编写于 作者: 无木

fix(cropper): cropper not destroy in time

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

fixed: #1027
上级 26f251e1
### 🐛 Bug Fixes
- **Cropper** 修复未能及时销毁的问题
- **BasicTable** 修复`CellFormat`无法使用`Map`类型数据的问题
- **Qrcode** 修复二维码组件在创建时未能及时绘制的问题
## 2.7.0(2021-08-03)
## (破坏性更新) Breaking changes
......
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册