cherry-markdown
cherry-markdown copied to clipboard
[Bug] 预览模式
Prerequisites
- [ ] There isn't an existing issue that requests the same feature, to avoid duplicates.
Issue Type
Feature Request
Description of the Problem or Idea
// previewOnly: 预览模式(没有编辑框,toolbar只显示“返回编辑”按钮,可通过toolbar切换成编辑模式) defaultModel: 'previewOnly', 按照配置将defaultModel设置成了previewOnly,但是toolbar没有显示“返回编辑按钮”,请问这个是需要自定义吗?
Further Information
No response
Contributing
None
确实这里有问题,我们讨论下怎么修复哈
临时解决办法如下:
- 配置切换按钮
toolbars: {
toolbar: [
'switchModel',
'|',
'bold',
'italic',
.....
.....
- 在完成实例化后,调用切换模式的api(需要连续两次,第一次隐藏预览区,第二次才是切换成纯预览模式)
cherry.toolbar.toolbarHandlers.switchModel();
cherry.toolbar.toolbarHandlers.switchModel()
完整配置可参考这里:https://tencent.github.io/cherry-markdown/examples/h5.html