Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@tntd/react-watermark

Package Overview
Dependencies
Maintainers
10
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tntd/react-watermark

配置babel,编译react为es5。

latest
npmnpm
Version
1.2.1
Version published
Maintainers
10
Created
Source

水印插件

配置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
};

FAQs

Package last updated on 07 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts