# lm-mask

> * 作者：niuguimin * 邮箱：15275151030@163.com * 版本：**`1.0.0`**

Latest version **1.0.0** (published 2020-06-02) · 0 weekly downloads

## Install

```sh
npm install lm-mask
pnpm add lm-mask
yarn add lm-mask
bun add lm-mask
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-06-02 |
| First published | 2017-11-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 25.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | niuguimin |
| Maintainers | davidfeng, niuguimin, sherry.cao, yingq |
| Keywords | earth, react, reactcomponent, mask |

## Links

- npm: https://www.npmjs.com/package/lm-mask
- Repository: https://github.com/lm-component/mask
- Homepage: https://github.com/lm-component/mask#readme
- Issues: https://github.com/lm-component/mask/issues
- npm.io page: https://npm.io/package/lm-mask

## Dependencies (6)

- [promise](https://npm.io/package/promise.md) 8.0.1
- [lm-portal](https://npm.io/package/lm-portal.md) ^0.2.2
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [whatwg-fetch](https://npm.io/package/whatwg-fetch.md) 2.0.3
- [pinkie-promise](https://npm.io/package/pinkie-promise.md) ^2.0.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-06-02
- 0.2.10 — 2019-11-15
- 0.3.0 — 2019-09-11
- 0.2.9-test — 2019-08-30
- 0.2.9 — 2019-04-28
- 0.2.8 — 2018-12-07
- 0.2.7 — 2018-12-05
- 0.2.5 — 2018-07-17
- 0.2.4 — 2018-07-16
- 0.2.3 — 2018-07-14
- 0.2.2 — 2018-07-13
- 0.2.1 — 2018-06-26
- 0.2.0 — 2018-06-26
- 0.1.5 — 2018-06-19
- 0.1.4 — 2018-06-19
- … 4 more at https://npm.io/package/lm-mask/versions

## README

# mask

* 作者：niuguimin
* 邮箱：15275151030@163.com
* 版本：**`1.0.0`**

## 介绍

mask蒙层


## 安装

`lm-*` 组件使用 `npm` 进行管理，命名空间统一为 `lm-`，请使用以下命令进行组件安装。

```
npm i lm-mask --save
```

- 如果你还没有安装 `npm`，可通过以下方式进行 [安装](https://nodejs.org/en/download/)。
- 安装cnpm `npm install -g cnpm --registry=https://registry.npm.taobao.org`



## 使用

### 样例文档

- 待开发

### 使用
最少配置参数为：
- 传入内容
- 配置visible和opacity属性

```
<Mask 
    visible={ this.state.visible }

    opacity={3}

    onMaskClick={()=>this.setState({visible: false})}
>
    <div>This is content</div>
</Mask>

```
### 配置参数

| Prop | Type | Default | Description |
| ---- |:----:|:-------:| :----------:|
| **`visible`** | `bool` | `undefined` | 是否可见 |
| **`opacity`** | `number` | `undefined` | 透明度 0-1 |
| **`zIndex`** | `number` | `999` | z-index属性 |
| **`onMaskClick`** | `function` | `undefined` | 点击回调 |


## 注意事项

- mask外层包裹了lm-protal组件，默认append到body中。
- 可传入[protal](https://github.com/lm-component/portal)的参数，见配置参数后三属性
- mask内组件需要阻止冒泡,否则会触发onMaskClick


## 开发调试

进入项目目录后，使用 `node` 命令启动服务

```
npm run start
```

打包发布可通过 `node` 命令执行

```
npm run build
npm publish
```



## 相关资料

* [lm 组件开发规范](http://)



## Changelog

### 0.1.0
1. init

### 0.1.2
- modify animation name to solve style conflict

### 0.1.3
- add zIndex prop & modify opacity prop

### 0.1.4
- remove props time and timeCallback
- optimize animation

### 0.1.5
- just upgrade version


### 0.2.1
- upgrade to React 16

### 0.2.2
- bugfix for huawei mask scroll (by modify css3 animation)

### 0.2.3
- forbid scroll when mask show

### 0.2.4
- forbid scroll when mask show & relative bug fix


### 0.2.5
- bugfix for mask scroll

### 0.2.7
- update lm-portal for ssr

### 1.0.0
- Update styles based on new UI

---

---
_Source: https://npm.io/package/lm-mask · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
