mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 01:29:11 +08:00
3d8cd0b451
* feat: switch visible to open for Modal * test: depcated check * docs: site api update Co-authored-by: 二货机器人 <smith3816@gmail.com>
857 B
857 B
order | title | ||||
---|---|---|---|---|---|
13 |
|
zh-CN
使用 width
来设置模态对话框的宽度。
en-US
Use width
to set the width of the modal dialog.
import { Button, Modal } from 'antd';
import React, { useState } from 'react';
const App: React.FC = () => {
const [open, setOpen] = useState(false);
return (
<>
<Button type="primary" onClick={() => setOpen(true)}>
Open Modal of 1000px width
</Button>
<Modal
title="Modal 1000px width"
centered
open={open}
onOk={() => setOpen(false)}
onCancel={() => setOpen(false)}
width={1000}
>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
</Modal>
</>
);
};
export default App;