import Modal from 'nes-design/es/Modal'; OR import { Modal } from 'nes-design';
NES.css does not include any JavaScript. If you want to use dialog element other than Chrome, you need polyfill.
官方未提供 dialog 的 polyfill,使用请注意浏览器兼容性。
Modal Attr: round: false / theme:
Prop / 参数 | Description / 描述 | Type / 类型 | Default / 默认值 |
---|---|---|---|
visible | modal visible | boolean | - |
width | modal width | number | 520 |
theme | modal theme | 'dark' | - |
round | modal shape | boolean | - |
cancelProps | modal footer cancel button props | ButtonProps | - |
okProps | modal footer ok button props | ButtonProps | - |
onCancel | modal click cancel callback | (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; | - |
onOk | modal click ok callback | (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; | - |
renderFooter | custom footer | (dialog: HTMLDialogElement) => React.ReactNode; | - |
children | custom children | (dialog: HTMLDialogElement) => React.ReactNode; | - |
...rest | more attrs | React.DialogHTMLAttributes<HTMLDialogElement>; | - |