perf(tree): 改进beforeRightClick回调支持对菜单进行更多配置 #608
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
当tree处于抽屉或者对话框中时,右键菜单会因为z-index太低而没能显示在对话框或抽屉的上层。
此PR修改了对beforeRightClick的回调的处理,允许beforeRightClick返回菜单的items数组(兼容之前的代码写法)或者返回ContextMenuOptions来对右键菜单进行更多定制,比如返回{styles:{"z-index":2010},items}来让右键菜单可以在抽屉或弹窗中正确显示。