如何在ant design选项卡上添加Tooltip?

gpb*_*lio 1 reactjs antd

我有这段代码,我想要在选项卡上执行的操作是在图标上添加工具提示:

<Tabs.TabPane tab={<Tooltip placement="left" title="adasd"><Icon size="1.2" name="cog" /></Tooltip>} key="map">
  <MapProperties onChange={onChange} canvasRef={canvasRef} />
</Tabs.TabPane>
Run Code Online (Sandbox Code Playgroud)

我期待悬停显示,但它不起作用。是否可以在选项卡窗格上添加 ant design 工具提示?

Vel*_*eli 7

Anuj's answer isn't correct since TabPane should be direct children of Tabs component. I also had such problem and I find out that i can solve it like this:

<TabPane
  key="3"
  tab={(
    <Tooltip title="Your hint that appears after user's mouse will be over the tab title">
       <span>tab title</span>
    </Tooltip>
  )}
  disabled={mode === PageMode.NEW}
>
Run Code Online (Sandbox Code Playgroud)

tab attribute accepts any ReactNode so we can just wrap our tab name with any component. And tooltip isn't exception.

Proof that this works