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

[Feature Request] 新增目录展开/收起的API实现 #897

Open
1 task
Wscats opened this issue Sep 6, 2024 · 4 comments
Open
1 task

[Feature Request] 新增目录展开/收起的API实现 #897

Wscats opened this issue Sep 6, 2024 · 4 comments
Labels
🚀enhancement New feature or request

Comments

@Wscats
Copy link

Wscats commented Sep 6, 2024

Prerequisites

  • There isn't an existing issue that requests the same feature, to avoid duplicates.

Clear and concise description of the problem

企业微信截图_9fae56e3-3c93-4b22-8fb7-d2835084e28d 这个目录的开关可否新增个API呢😊 类似这样的调用方式

Suggested solution

cherry.toolbar.toolbarHandlers.toggleToc();

感谢🙏

@Wscats Wscats added the 🚀enhancement New feature or request label Sep 6, 2024
@Wscats Wscats changed the title [Feature Request] [Feature Request]新增目录开关的API实现 Sep 6, 2024
@RSS1102
Copy link
Collaborator

RSS1102 commented Sep 6, 2024

你指的是在开启toc模式下,控制toc的展开和折叠?

@Wscats
Copy link
Author

Wscats commented Sep 6, 2024

你指的是在开启toc模式下,控制toc的展开和折叠?

是的,开启了toc,想用接口方式调用展开和折叠

@sunsonliu
Copy link
Collaborator

目前没有开放出来api,不过可以通过下面的方式控制,欢迎尝试哈:

// 展开
cherry.toc.$switchModel('full')
cherry.toc.setModelToLocalStorage('full')

// 收起
cherry.toc.$switchModel('pure')
cherry.toc.setModelToLocalStorage('pure')

@Wscats
Copy link
Author

Wscats commented Sep 6, 2024

目前没有开放出来api,不过可以通过下面的方式控制,欢迎尝试哈:

// 展开
cherry.toc.$switchModel('full')
cherry.toc.setModelToLocalStorage('full')

// 收起
cherry.toc.$switchModel('pure')
cherry.toc.setModelToLocalStorage('pure')

好的呢~我试试

@Wscats Wscats changed the title [Feature Request]新增目录开关的API实现 [Feature Request] 新增目录开关的API实现 Sep 26, 2024
@RSS1102 RSS1102 changed the title [Feature Request] 新增目录开关的API实现 [Feature Request] 新增目录展开/收起的API实现 Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants