Skip to content

Commit

Permalink
add badges
Browse files Browse the repository at this point in the history
  • Loading branch information
FatDoge committed Aug 2, 2019
1 parent 5c08e66 commit 01623ce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions Loading/index.js
Expand Up @@ -6,6 +6,7 @@ const containerStyle = {
alignItems: 'center',
background: 'white',
color: 'black',
height: '-webkit-fill-available'
}
class LoadingContainer extends Component {

Expand Down
9 changes: 8 additions & 1 deletion README.md
@@ -1,7 +1,14 @@
### watermark-enhancer
## watermark-enhancer
> Add watermark to your react components in a more elegent way.
![](https://img.shields.io/npm/l/watermark-enhancer)
![](https://img.shields.io/npm/dt/watermark-enhancer)
![](https://img.shields.io/bundlephobia/minzip/watermark-enhancer?label=package%20size)

![case](https://cdn.fatdoge.cn/watermark-enhancer-user.png)![case](https://cdn.fatdoge.cn/watermark-enhancer-view.png)
> 移步[详细文档](https://fatdoge.github.io/watermark-enhancer)

1.安装
```
npm i watermark-enhancer -d
Expand Down
2 changes: 1 addition & 1 deletion WaterMark/index.js
Expand Up @@ -42,7 +42,6 @@ const watermark = ({

const base64Url = canvas.toDataURL();
const __wm = document.querySelector('.__wm');

const watermarkDiv = __wm || document.createElement("div");
const styleStr = `
position:absolute;
Expand All @@ -67,6 +66,7 @@ const watermark = ({
if (MutationObserver) {
let mo = new MutationObserver(function () {
const __wm = document.querySelector('.__wm');
console.log(__wm)
// 只在__wm元素变动才重新调用 __canvasWM
if ((__wm && __wm.getAttribute('style') !== styleStr) || !__wm) {
// 避免一直触发
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 01623ce

Please sign in to comment.