1.0.0-alpha • Published 3 years ago
react-outside-click-weilong v1.0.0-alpha
@mlamp/react-outside-click
本组件实现了组件外部点击触发click事件,常用于点击外部关闭当前组件的功能。
Installation
$ npm set registry http://npm.po.mlamp.cn
$ npm i @mlamp/react-outside-click
publish
首次发布
$ npm run release -- --first-release
发布预发布版本
$ npm run release -- --prerelease alpha
释放一个版本
$ npm run release
强制发布一个版本,如1.0.0
$ npm run release --release-as 1.0.0
Usage
import { ReactOutsideClick } from '@mlamp/react-outside-click'
class App extends React.Component {
render() {
return (
<ReactOutsideHandle handleClick={() => alert('点击了我')}>
<div>点我没反应</div>
</ReactOutsideHandle>
);
}
}
API
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
children | 组件包裹的内容 | node | - |
handleClick | 回调函数,点击组件外部后触发 | func | - |
style | 组件sytle | object | - |
Keywords
react, react-outside-click,
Demo
1.0.0-alpha
3 years ago