We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
鼠标悬浮 button myBtn 上
鼠标悬浮 myBtn 上显现 tooltip
鼠标悬浮 myBtn 上未显现 tooltip
import React from 'react'; import ReactDOM from 'react-dom'; import 'antd/dist/antd.css'; import './index.css'; import { Tooltip, Button } from 'antd';
const MyButton = () => { return ( myBtn ) }
ReactDOM.render(
The text was updated successfully, but these errors were encountered:
试试这个:https://codesandbox.io/s/jiben-antd4150-forked-izlhz?file=/index.js
因为 tooltip 会监听子元素的鼠标事件,MyButton 需要把传入的监听器透传给 Button,这个 Button 的事件可以冒泡到 tooltip 上,否则中间就中断了。
Sorry, something went wrong.
试试这个:https://codesandbox.io/s/jiben-antd4150-forked-izlhz?file=/index.js 因为 tooltip 会监听子元素的鼠标事件,MyButton 需要把传入的监听器透传给 Button,这个 Button 的事件可以冒泡到 tooltip 上,否则中间就中断了。
https://codesandbox.io/s/jiben-antd4150-forked-birg6?file=/index.js 试了下 透传props, 但是如果Button是disabled下又不可以了
#9581 (comment)
No branches or pull requests
Reproduction link
Steps to reproduce
鼠标悬浮 button myBtn 上
What is expected?
鼠标悬浮 myBtn 上显现 tooltip
What is actually happening?
鼠标悬浮 myBtn 上未显现 tooltip
import React from 'react';
import ReactDOM from 'react-dom';
import 'antd/dist/antd.css';
import './index.css';
import { Tooltip, Button } from 'antd';
const MyButton = () => {
return (
myBtn
)
}
ReactDOM.render(
The text was updated successfully, but these errors were encountered: