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

tooltip的属性容易造成冲突 #3620

Closed
HalfLegend opened this issue Jun 21, 2019 · 3 comments
Closed

tooltip的属性容易造成冲突 #3620

HalfLegend opened this issue Jun 21, 2019 · 3 comments
Assignees

Comments

@HalfLegend
Copy link

What problem does this feature solve?

tooltip组件的属性,如nzTitle nzPlacement看不出来源,且容易造成冲突
像某个元素上有 nzTitle nzPlacement nzContent 等属性,看上去好像是元素自己的属性或者某种全局属性,但实际上是由于 nz-tooltip的存在才引入的,非常不友好,可读性不强
像 nzTitle nzContent 这种属性,其它组件很容易也存在此名字的属性,很容易冲突

What does the proposed API look like?

  1. nzTitle属性没有意义,应该去掉: 可以直接使用 nz-tooltip="XXX"。没必要再额外设置nzTitle
  2. 其它属性,如 nzPlacement nzContent 命名应当加入其来源,如 nzTooltipPlacement nzTooltipContent
    (请参考其它框架:如 https://material.angular.io/components/tooltip/examples
    https://akveo.github.io/nebular/docs/components/tooltip/overview#nbtooltipdirective)
@zorro-bot
Copy link

zorro-bot bot commented Jun 21, 2019

Translation of this issue:

Tooltip attributes are prone to conflicts

What problem does this feature solve?

The properties of the tooltip component, such as nzTitle nzPlacement, do not see the source and are prone to conflicts.
Like an element with attributes such as nzTitle nzPlacement nzContent, it looks like the element's own property or some global property, but it is actually introduced because of the existence of nz-tooltip, very unfriendly, not very readable.
Like nzTitle nzContent, other components are easy to have properties of this name, it is easy to conflict

What does the proposed API look like?

  1. The nzTitle attribute has no meaning and should be removed: You can use nz-tooltip="XXX" directly. No need to set up nzTitle
  2. Other properties, such as nzPlacement nzContent naming should be added to its source, such as nzTooltipPlacement nzTooltipContent
    (Please refer to other frameworks: eg https://material.angular.io/components/tooltip/examples
    Https://akveo.github.io/nebular/docs/components/tooltip/overview#nbtooltipdirective)

@darshanrampatel
Copy link
Contributor

Duplicate of #3456

@wzhudev
Copy link
Member

wzhudev commented Jun 22, 2019

Closed because of duplication.

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

3 participants