React 框架+ antd组件库 Modal.method()提示框
import React from 'react'
import { Modal } from 'antd'
const PromptTips = ({
title,
content,
}) => {
//提示弹窗
const showPromptModal = () => {
Modal.confirm({
title: title,
content:(
<div>
{/* <p>您还不是会员,无法使用该功能!</p> */}
<p>{content}</p>
</div>
),
okText:'成为会员',
cancelText: '知道了',
okType: 'danger',
onOk() {
console.log('OK');
},
onCancel() {
console.log('cancel');
}
});
}
return showPromptModal();
}
export default PromptTips;
效果图:
完整代码:
jsx:
import React from 'react'
import { Modal } from 'antd'
import &#