epub react阅读器如何实现文本高亮?

问题描述 投票:0回答:2

我使用 this 实现了 React 阅读器。然后我使用this example实现了突出显示文本。但是我遇到了以下错误: TypeError: contents.mark 不是函数

谁能帮我修一下?

reactjs epub react-functional-component epub.js
2个回答
0
投票

看起来那个例子已经过时了。你最好看看“亮点”的例子。

mark()
函数实际上存在于
annotations
对象上,它是
rendition
的一部分而不是
content
mark
highlight
underline
本质上都是一样的,只是风格有点不同。

你应该可以打电话给

rendition.annotations.mark(cfiRange)
.


0
投票

此视频不仅可以帮助您了解亮点,还可以帮助您了解 react-reader 的其他功能。 https://youtu.be/j7upMyWWKrk

© www.soinside.com 2019 - 2024. All rights reserved.