react-zmage icon indicating copy to clipboard operation
react-zmage copied to clipboard

提几点建议

Open xclw2000 opened this issue 4 years ago • 3 comments

1.放大功能需要增强,能够用鼠标滚轮放大缩小 2.Image的其他属性应该暴露出来,比如title属性 3.可以自定义功能按钮的样式

xclw2000 avatar Oct 30 '19 02:10 xclw2000

关于 title 属性,我看了一下现在的代码,目前似乎是直接读取的 alt 属性,暂时可以用这个替代,应该是当时手抖写错了 至于其他属性你都可以直接传,没有写出来的属性都会直接被合并到原始的 image 对象上

其他两点以后有空再做吧

Caldis avatar Oct 30 '19 02:10 Caldis

// 組裝屬性 const commonProps = { key:${imageIndexWithStep}-${set[imageIndex].src}, style: imageStyle, className: imageClass, src: appendParams(set[imageIndex].src, { t: this.handleGetTimestamp(page) }), alt: set[imageIndex].alt, } const centerProps = { id: "zmageImage", ref: this.imageRef, onLoad: this.handleImageLoad, onError: this.handleImageError, onAbort: this.handleImageAbort, onClick: this.handleClick, } // 構建内容 if (isSideImage) { const sideImageShow = show && set.length>1 && !zoom return sideImageShow && <img {...commonProps}/> } else { return <img {...commonProps} {...centerProps}/> } alt属性还是映射到image.alt属性,所以设了也没用,而且代码中已经限制死了就这些属性,并没有合并

xclw2000 avatar Oct 30 '19 03:10 xclw2000

这个确实是个问题,我以为你指的是封面图片的属性 这个后续有待优化, 谢谢指正

Caldis avatar Oct 30 '19 03:10 Caldis