Giter Site home page Giter Site logo

fatdoge / watermark-enhancer Goto Github PK

View Code? Open in Web Editor NEW
65.0 2.0 9.0 337 KB

Add watermark to react components in a more elegant way

Home Page: https://fatdoge.github.io/watermark-enhancer/#/

License: MIT License

JavaScript 100.00%
react hoc watermark

watermark-enhancer's Introduction

watermark-enhancer

Add watermark to your react components in a more elegent way.

casecase

移步详细文档

1.安装

npm i watermark-enhancer -d

2.使用

import EnhancerWaterMark from 'watermark-enhancer'
export default EnhancerWaterMark({
  width: '100',
  height: '80',
  rotate: '17',
  content: 'test',
  asyncContent: renderEffectContent,
}, {
  content: 'watermark loading...',
  color: 'black',
  background: 'white'
})(WrappedComponent)

3.注意

  • 参数说明
    EnhancerWaterMark(
      watermarkOptions = {
        content : 'sync content',
        asyncContent: renderEffectContent,
      }, // 水印参数, 水印内容可异步获取
      loadingOptions = {
        ...loadingStyle,
        content: 'loading...'
      }, // loading遮罩层配置
    )(WrappedComponent) // 传入需要加上水印的组件
    
  • 同步的水印内容
    EnhancerWaterMark(
      options = {
        + content: '水印',
        width,
        height,
        ...  
      }, 
    )(WrappedComponent)
    
  • 异步的水印内容
    EnhancerWaterMark(
      - content,
      + asyncContent: renderEffectContent,  
      options = {
        width,
        height,
        ...  
      }, 
    )(WrappedComponent)
    

watermark-enhancer's People

Contributors

fatdoge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

watermark-enhancer's Issues

水印可以加上但是没有卸载

我进入一个页面时水印加载了
当返回上一级页面时 水印还在 水印是挂在在了body的直接子节点上
有什么办法unmount

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.