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

transfer组件item title在自定义render下不准确 #12399

Closed
shudery opened this Issue Sep 25, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@shudery

shudery commented Sep 25, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

自定义render时,如果render函数返回的是字符串则item的title显示正常,但如果返回的是一个JSX,item的title属性会变为'[object Object]'。

What does the proposed API look like?

组件提供一个属性,方便控制title的展示。
或者组件内部渲染item title时做一个判断,不是string的就不要展示了。

@zombieJ

This comment has been minimized.

Member

zombieJ commented Sep 25, 2018

调整了一下逻辑,只有是 string 才显示 title,可以配合:

render={item => (<span title="your logic">{item.title}</span>)}

来自定义 title

@shudery

This comment has been minimized.

shudery commented Sep 26, 2018

good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment