@tntd/react-watermark

    1.2.1 • Public • Published

    水印插件

    配置babel,编译react为es5。

    安装

    npm install @tntd/react-watermark --save
    

    使用

    import Watermark from "@tntd/react-watermark";
    
     <Watermark
        text="Hello World"
        subtext="xiaoming"
        options={{
          color: "#ddd",
          rotate: 30,
          fontSize: 16,
          fontWeight: 300,
          fontFamily: "黑体",
          fontAjust: 1,
          offsetX: 100,
          offsetY: 50
        }}
      >
        <div className="content">
          text
        </div>
     </Watermark>
    

    参数说明

    • text 主文本,为必传参数
    • subtext 副文本,非必传参数
    • options 设有默认值,可根据自己的需求配置一个或多个项
    const defaultOptions = {
        rotate: 30,
        backgroundColor: "#fff",
        color: "rgba(0, 0, 0, 0.1)",
        width: "100%",
        height: "auto",
        fontSize: 12,
        fontWeight: 300,
        fontFamily: "黑体",
        fontAjust: 1.2,
        offsetX: 0,
        offsetY: 0
    };
    

    Keywords

    none

    Install

    npm i @tntd/react-watermark

    DownloadsWeekly Downloads

    0

    Version

    1.2.1

    License

    none

    Unpacked Size

    8.6 kB

    Total Files

    4

    Last publish

    Collaborators

    • ezios
    • td-tnt
    • bruceliu68
    • bernardzhang
    • mizy
    • zhouzefei
    • leocmial
    • xiaofei.wang
    • anthonyli
    • xiaocuicui
    • popoqaq