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

关于BasicTree的事件参数暴露属性不全的建议 #315

Closed
ChaosLcc opened this issue Mar 2, 2021 · 7 comments · Fixed by #636
Closed

关于BasicTree的事件参数暴露属性不全的建议 #315

ChaosLcc opened this issue Mar 2, 2021 · 7 comments · Fixed by #636

Comments

@ChaosLcc
Copy link

ChaosLcc commented Mar 2, 2021

如图

476366EA383B180FCDCD7F8B91F94173

@anncwb
Copy link
Collaborator

anncwb commented Mar 2, 2021

提供下你的代码,这样看不出来

@anncwb
Copy link
Collaborator

anncwb commented Mar 2, 2021

不知道你为什么要从这里取,因为项目是用slot来渲染,所以不能直接暴露出title,下次提交我会暴露一个node节点来获取

@anncwb anncwb closed this as completed in b6bb816 Mar 2, 2021
@ChaosLcc
Copy link
Author

ChaosLcc commented Mar 3, 2021

不知道你为什么要从这里取,因为项目是用slot来渲染,所以不能直接暴露出title,下次提交我会暴露一个node节点来获取

截图中的代码

<a-tree
  @select="selectTree"
  :selectedKeys="selectedKeys"
  :treeData="treeData"
  :checkable="true"
/>
  const selectTree = (keys, { selectedNodes, node }) => {
    console.log(keys)
    console.log('selectedNodes', selectedNodes)
    console.log(node)
    selectedKeys.value = keys
    selectedTitle.value = selectedNodes[0].props.title
  }

a-tree的@select事件第二个对象参数selectedNodes, node都能取到title和其他属性值,至于为什么从这里取,因为懒吧

@jekip
Copy link

jekip commented May 20, 2021

请问,你怎么解决了,现在最新代码,还是无法直接获取 title 和其他字段

@ChaosLcc
Copy link
Author

请问,你怎么解决了,现在最新代码,还是无法直接获取 title 和其他字段

我用的a-tree,我也没看最新的代码

@mynetfan
Copy link
Collaborator

const selectTree = (keys, { node }) => {
console.log(node.$attrs)
}

@jekip
Copy link

jekip commented May 21, 2021

BasicTree 并没有看到有返回 node ,你究竟是(绑定/监听)哪个魔术方法获取了node ??

@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 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

Successfully merging a pull request may close this issue.

4 participants