Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

预览大图时图片未刷新的问题 #143

Open
guichun68 opened this issue Jan 2, 2023 · 3 comments
Open

预览大图时图片未刷新的问题 #143

guichun68 opened this issue Jan 2, 2023 · 3 comments

Comments

@guichun68
Copy link

在预览大图时我对图片做了旋转操作,在旋转的事件回调中将该图片旋转后的canvas数据重新赋值到了缩略图数组的img标签的src中,并通过react的state对图片数组重新赋值,将预览关闭后,发现虽然缩略图组件已经显示旋转后效果了,但预览图并没有重新读取该state中images数组值进行展示,还是旧的未旋转的图片。
error

@MinJieLiu
Copy link
Owner

关闭时,会有 onRotate 回调重置掉,这个操作你可以屏蔽掉。然后第二次打开后你再调用 onRotate 设置回去

@guichun68
Copy link
Author

关闭时,会有 onRotate 回调重置掉,这个操作你可以屏蔽掉。然后第二次打开后你再调用 onRotate 设置回去

关闭时会有onRotate回调?怎么拿到这个回调去屏蔽呢,onClose参数里没发现有这个函数,打印出来貌似是一个普通的点击事件,不太会用呢:flushed:

@MinJieLiu
Copy link
Owner

这样,你 images 图片数组中的地址有变化吗,如果发生了变化,或者强制给个 key 都可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants