Skip to content

Commit 50782a1

Browse files
authored
fix: 🐛 修复 wd-img-cropper 组件在微信小程序中旋转图片后操作卡顿的问题 (#1112)
1 parent eddbd5d commit 50782a1

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/uni_modules/wot-design-uni/components/wd-img-cropper/wd-img-cropper.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,12 @@ const imageStyle = computed(() => {
265265
/**
266266
* 逆转是否使用动画
267267
*/
268-
function revertIsAnimation(animation: boolean) {
269-
isAnimation.value = animation
268+
function revertIsAnimation(animation: boolean | { value: boolean }) {
269+
if (typeof animation === 'boolean') {
270+
isAnimation.value = animation
271+
} else {
272+
isAnimation.value = animation.value
273+
}
270274
}
271275
272276
/**
@@ -642,7 +646,7 @@ defineExpose<ImgCropperExpose>({
642646
function setAnimation(newValue, oldValue, ownerInstance){
643647
if (newValue) {
644648
var id = ownerInstance.setTimeout(function() {
645-
ownerInstance.callMethod('revertIsAnimation',false)
649+
ownerInstance.callMethod('revertIsAnimation',{value:false})
646650
ownerInstance.clearTimeout(id)
647651
},300)
648652
}

0 commit comments

Comments
 (0)