[英]Semantic-ui react modal shorthand prevent button closing modal
使用下面显示的文档页面上的代码作为速记模式,如何阻止按钮关闭操作属性中的模式? 我试过preventDefault,没有运气,它让我难住了?
import React from 'react'
import { Button, Modal } from 'semantic-ui-react'
const ModalExampleShorthand = () => (
<Modal
trigger={<Button>Show Modal</Button>}
header='Reminder!'
content='Call Benjamin regarding the reports.'
actions={['Snooze', { key: 'done', content: 'Done', positive: true }]}
/>
)
export default ModalExampleShorthand
不敢相信我没有想到这一点,我只需要在动作中添加 onClick 处理程序,即:
actions={['Snooze', { key: 'done', content: 'Done', positive: true, onClick: myFunc }]}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.