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

Tree的actionList的类型ActionItem能否加一个condition字段 #314

Closed
tky753 opened this issue Mar 2, 2021 · 1 comment
Closed

Comments

@tky753
Copy link

tky753 commented Mar 2, 2021

Problem

现在所有Tree节点的action item个数都是统一的,特定节点想要不显示,得要

render: () => {
  if(xxxx) return h('span');
  return h(......);
}

能不能把if(xxxx)这个条件单拎出来呢?
比如,ActionItem 加一个 condition: (record: any) => bool

@anncwb
Copy link
Collaborator

anncwb commented Mar 2, 2021

export interface ActionItem {
  render: (record: Recordable) => any;
  show?: boolean | ((record: Recordable) => boolean);
}

@anncwb anncwb closed this as completed in 8b62fa0 Mar 2, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants