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

这个还原不会高亮显示 #74

Open
316335930 opened this issue Apr 13, 2021 · 4 comments
Open

这个还原不会高亮显示 #74

316335930 opened this issue Apr 13, 2021 · 4 comments
Labels
question Further information is requested

Comments

@316335930
Copy link

highlighter.fromStore(hs.startMeta, hs.endMeta, hs.text, hs.id, hs.extra) 这个还原不会高亮显示

@alienzhou
Copy link
Owner

需要提供更多的报错信息,或者可复现的 demo

@alienzhou alienzhou added the question Further information is requested label Jun 24, 2021
@ddddderek
Copy link

我也遇见同样的问题了。

Highlighter.event.CREATE hook 中调用 isHighlightSource 静态方法 传入source对象,返回结果竟然是false。

@Neo-Chaos
Copy link

highlighter.fromStore(hs.startMeta, hs.endMeta, hs.text, hs.id, hs.extra) 这个还原不会高亮显示

你是不是把这个写在生命周期mounted里面的?如果你的页面存在异步加载文件,他会无法成功还原高亮,你需要自己解决时序问题

@Neo-Chaos
Copy link

create钩子中回传的内容是一个对象,{sources, type}你需要自己结构一下拿出sources才可以使用isHighlightSource函数进行判断

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

No branches or pull requests

4 participants