-
Notifications
You must be signed in to change notification settings - Fork 421
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
fix(type): type error in config #839
Conversation
这样可以吗 |
这样可以吗 但是还有一个就是自定义的按钮咋办,他们不在这个范围内。。 |
这样可以吗 看下这样是否可以解决,获取customMenu中用户自定义的key值,用于CherryInsertToolbar的校验 |
看下这样是否可以解决,获取customMenu中用户自定义的key值,用于CherryInsertToolbar的校验这样可以吗 我试一下 |
😞😞目前怎么推导 type CherryTopToolbarKeys =
| 'bold'
| 'italic'
| 'strikethrough'
| 'color'
| 'header'
| 'list'
| 'image'
| 'audio'
| 'video'
| 'link'
| 'hr'
| 'br'
| 'code'
| 'formula'
| 'toc'
| 'table'
| 'pdf'
| 'word'
| 'graph'
| 'settings'
| 'insert';
export type CherryToolbarSeparator = '|';
type CustomToolbarKeys = keyof CherryToolbarOptions['customMenu'];
export type CherryDefaultToolbar =
| CherryInsertToolbar
| CherryToolbarSeparator
| CherryTopToolbarKeys;
export type CherryInsertToolbar = {
[key in CherryTopToolbarKeys & CustomToolbarKeys]?: string[];
}; |
@Saraph1nes |
在
toolbar
中 设置包含二级菜单栏的时候,遇到一级菜单栏错误。这里设置成了
string
类型进行通配,但是感觉这种失去了约束力。你有空给看下,怎么设置这个类型比较好@lyngai