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

[Bug] 预览模式 #713

Open
1 task
wu740027007 opened this issue Feb 2, 2024 · 2 comments
Open
1 task

[Bug] 预览模式 #713

wu740027007 opened this issue Feb 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@wu740027007
Copy link

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

@wu740027007 wu740027007 added the client client question label Feb 2, 2024
@sunsonliu sunsonliu added bug Something isn't working and removed client client question labels Feb 2, 2024
@sunsonliu
Copy link
Collaborator

确实这里有问题,我们讨论下怎么修复哈

@sunsonliu
Copy link
Collaborator

sunsonliu commented Feb 2, 2024

临时解决办法如下:

  1. 配置切换按钮
 toolbars: {
    toolbar: [
      'switchModel',
      '|',
      'bold',
      'italic',
.....
.....
  1. 在完成实例化后,调用切换模式的api(需要连续两次,第一次隐藏预览区,第二次才是切换成纯预览模式)
cherry.toolbar.toolbarHandlers.switchModel();
cherry.toolbar.toolbarHandlers.switchModel()

完整配置可参考这里:https://tencent.github.io/cherry-markdown/examples/h5.html

@RSS1102 RSS1102 changed the title [Client] [Bug] 预览模式 Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants