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

Card activeTabKey or tabActiveKey #24208

Closed
afc163 opened this issue May 16, 2020 · 10 comments
Closed

Card activeTabKey or tabActiveKey #24208

afc163 opened this issue May 16, 2020 · 10 comments

Comments

@afc163
Copy link
Member

afc163 commented May 16, 2020

Are tabActiveKey and defaultTabActiveKey better prop name?

In pro-layout it named to tabActiveKey.

@afc163 afc163 changed the title Card activeTabKey Card activeTabKey naming issue May 16, 2020
@AshoneA
Copy link
Contributor

AshoneA commented May 17, 2020

我觉得改了会造成 breaking change 的...

@afc163
Copy link
Member Author

afc163 commented May 17, 2020

如果要改肯定要兼容,然后加 warning。

@xrkffgg
Copy link
Member

xrkffgg commented May 18, 2020

Can it be simplified to active and default

@shaodahong
Copy link
Member

In my see, Card had many tab props, we can remove it(waring), and use it

<Card
  tabProps={{
    activeKey: 1,
    defaultActiveKey: 1
  }}
</>

@yoyo837
Copy link
Contributor

yoyo837 commented May 18, 2020

tab前缀的属性在Card tab相关功能中有明确指向性意图是tab相关功能使用的。个人建议保留。

@zombieJ
Copy link
Member

zombieJ commented May 18, 2020

没有特别的倾向性,感觉两者都差不多。原本的把 TabKey 作为一个标识,这个提议是把整个 tabActiveKey 作为标识。可改可不改的情况下建议不改。

PS: 定完了可以更新一下:https://github.com/ant-design/ant-design/wiki/API-Naming-rules

@afc163 afc163 changed the title Card activeTabKey naming issue Card activeTabKey or tabActiveKey May 18, 2020
@afc163
Copy link
Member Author

afc163 commented May 18, 2020

贴一下出处:
image

@zombieJ
Copy link
Member

zombieJ commented May 18, 2020

按照 naming standard,属性名都要先过一下已有的名称表。个人感觉 pro layout 才是 typo = =

@shaodahong
Copy link
Member

这种属于 compose 组件,心智上来说我觉得都放到 tabProps 更好,换个名字治标不治本

@hengkx
Copy link
Member

hengkx commented May 19, 2020

个人觉得不管是什么 最好是一种统一的风格,对于我这种有些强迫症的人来说,就好比 文档中的有的默认值用‘ 包裹 有的没有,我一直都想把所有的给他统一😭

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

No branches or pull requests

9 participants