Ant design 消息在 onclick 上不起作用
因此,我正在尝试在单击按钮时显示一条消息,但是它的作用是,当页面加载时,它会显示消息框(不应该发生),但它不起作用,但我已将屏幕截图附加到我的代码和观点。
/I.sstatic.net/i9pxb.png“ alt =”在此处输入图像描述”>
So I am trying to display a message when a button is clicked but what it does is that when the page is loaded it displays message boxes (which should not happen) but it doesn't work on onclick I have attached the screenshots to my code and views.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将函数传递给 onClick 参数,而不是调用它。
或者
You need to pass your function to the onClick parameter, not invoke it.
or