1.2.7 • Published 6 years ago
luban-modal v1.2.7
Prefix named Luban, salute the God of craftsman
usage
To avoid redundant code and for maximum style flexibility, all colors(such as bg color, font-color) must be defined by yourself in css style
npm i luban-modal --save
or
yarn add luban-modal --save
import Modal from 'luban-modal';
const Demo = () => {
const [show, setShow] = React.useState(false)
const onRight = (e) => {}
const onCancel = (e) => {
setShow(false)
}
const onLeft = (e) => {}
const onShow = () => {
setShow(true)
}
return (
<div>
<button onClick={onShow}>click</button>
{
show &&
<Modal
title='title title'
onRight={onRight}
right='Comfirm'
onCancel={onCancel}
onLeft={onLeft}
left='Cancel'
>
<div>line line</div>
<div>line line line lineline line</div>
</Modal>
}
</div>
)
}