confirmAlert({customUI:({onClose})=>{return(Are you sure?You want to delete this file?No{this.handleClickDelete();onClose();}}>Yes, Delete it!);}}); Install npm ireact-confirm-alert Repository Homepage Weekly Downloads 50,245 Version 3.0.6 License MIT Unpacked Size 19.1 kB ...
您还可以创建并传递自己的自定义UI组件,您可以以任何方式设置样式:
confirmAlert({customUI:({onClose})=>{return(Are you sure?You want to delete this file?No{this.handleClickDelete();onClose();}}>Yes, Delete it!);}}); Install npm ireact-confirm-alert-in-next Repository Homepage Weekly Downloads 1 Version 1.0.0 License ISC Unpacked Size 9.17 ...
$ npm install react-confirm-alert --save Options constoptions={title:'Title',message:'Message',buttons:[{label:'Yes',onClick:()=>alert('Click Yes')},{label:'No',onClick:()=>alert('Click No')}],childrenElement:()=>,customUI:({onClose})=>Custom UI,closeOnEscape:true,closeOnClick...