vvmodal
v1.4.3
Published
<h1 align='center'> <samp>vvmodal</samp> <a href='https://vvmodal.vercel.app/'> <img src='https://img.shields.io/npm/v/vvmodal?color=333&labelColor=555&style=flat-square' alt='version'/> </a> </h1>
Downloads
4
Readme
下载使用
npm i vvmodal
最简单的使用方法
import { antdModal, createGlobalModal, useModal, VVModalProvider } from "vvmodal";
import { Button, Modal } from "antd";
const Modal = createGlobalModal(() => {
const modal = useModal();
return (
<Modal {...antdModal(modal)}>
使用vvmodal管理modal状态
</Modal>
)
})
function App() {
return (
<VVModalProvider>
<Button onClick={() => Modal.show()}>点击展示</Button>
</VVModalProvider>
)
}
灵感来自于nice-modal-react