只读模式下能否做到图片点击放大
JiaweiUTSCHINA opened this issue · comments
JiaweiUTSCHINA commented
有点击回调触发的方法也可以
JiaweiUTSCHINA commented
好了解决了,
在Editor外套一个div,readOnly模式下可以onClick触发一个preview函数
函数里抓取e.target.closest('img');
const preview = useCallback((e: any) => {
const el = e.target.closest('img');
if (el && el.src) {
el.src && setOpen(true);
setFrameData({
filetype: 'JPG',
downloadurl: el.src,
srcType: 'editor'
});
}
}, []);
open为true使打开个全屏弹窗想办法渲染frameData即可