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

BreadcrumbItem的separator被父组件覆盖 #17812

Closed
1 task
quicksand-1 opened this issue Jul 23, 2019 · 5 comments
Closed
1 task

BreadcrumbItem的separator被父组件覆盖 #17812

quicksand-1 opened this issue Jul 23, 2019 · 5 comments
Assignees

Comments

@quicksand-1
Copy link
Contributor

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

在 Breadcrumb.Item 上写入 separator 属性后,并不生效。

What is expected?

Breadcrumb.Item 的 separator 不被父组件覆盖。

What is actually happening?

始终显示的是父组件的 separator。

Environment Info
antd 3.20.5
React 16.5.2
System macOs
Browser chrome

在源代码 Breadcrumb.tsx 文件的第 150 行中,父组件的 separator 覆盖了子组件的属性。

@afc163
Copy link
Member

afc163 commented Jul 23, 2019

应该是文档写错了,Breadcrumb.Item 不应该支持 separator

@afc163 afc163 closed this as completed in 17b27c9 Jul 23, 2019
@quicksand-1
Copy link
Contributor Author

@afc163

但是有些业务场景下需要 Item 也支持独立的 separator。

// 比如需要显示
当前位置:xxx > xxx >

我现在在本地通过给 Item 添加一个新的属性 separatorItem 来解决这样的问题。希望官方也能支持到。

image

@afc163
Copy link
Member

afc163 commented Jul 23, 2019

可以来个 Breadcrumb.Separator

<Breadcrumb separator="">  // 去掉分隔符
  <Breadcrumb.Item />
  <Breadcrumb.Separator />  // 默认分隔符
  <Breadcrumb.Item />
  <Breadcrumb.Separator>:</Breadcrumb.Separator> // 自定义分隔符
  <Breadcrumb.Item />
</Breadcrumb>

按这样的 API 来个 PR 如何?发到 feature 分支。

@quicksand-1
Copy link
Contributor Author

@afc163 看下这个 PR 是什么问题,是需要你们 review 后才会合并吗?feature 分支上
#17873

@zombieJ
Copy link
Member

zombieJ commented Jul 29, 2019

@long-zhuge ,点开 CI 的信息,里面有错误描述的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants