--- order: 2 title: zh-CN: 自定义页脚 en-US: Customized Footer --- ## zh-CN 更复杂的例子,自定义了页脚的按钮,点击提交后进入 loading 状态,完成后关闭。 不需要默认确定取消按钮时,你可以把 `footer` 设为 `null`。 ## en-US A more complex example which define a customized footer button bar. The dialog will change to loading state after clicking the submit button, and when the loading is done, the modal dialog will be closed. You could set `footer` to `null` if you don't need default footer buttons. ```jsx import { useState } from 'react'; import { Modal, Button } from 'antd'; export default () => { const [loading, setLoading] = useState(false); const [visible, setVisible] = useState(false); const showModal = () => { setVisible(true); }; const handleOk = () => { setLoading(true); setTimeout(() => { setLoading(false); setVisible(false); }, 3000); }; const handleCancel = () => { setVisible(false); }; return ( <> Return , , , ]} >

Some contents...

Some contents...

Some contents...

Some contents...

Some contents...

); }; ```