🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@zu1662/watermark-vue

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zu1662/watermark-vue

水印Vue3组件封装

latest
npmnpm
Version
1.1.2
Version published
Weekly downloads
24
71.43%
Maintainers
1
Weekly downloads
 
Created
Source

@zu1662/watermark-vue

基于 @zu1662/watermark 的组件封装

使用

# npm
npm install @zu1662/watermark-vue

# yarn
yarn add @zu1662/watermark-vue

全局注册组件

// main ts
import WaterMarkInstall from '@zu1662/watermark-vue';
const app = Vue.createApp()
app.use(WaterMarkInstall)

// 使用
<template>
  <WaterMark ref="aaa" class="date-picker" text="测试人员" :visible="visible">
    <someCom />
  </WaterMark>
</template>

组件引用

<template>
  <WaterMark ref="aaa" class="date-picker" text="测试人员" :visible="visible">
    <someCom />
  </WaterMark>
</template>
<script>
import { WaterMark } from '@zu1662/watermark-vue';
export default defineComponent({
  components: {
    WaterMark,
  }
})
</script>

API

基本参数

参数说明类型默认值
text水印文本, 为数组时表示多行水印string | string[]-
visible水印是否显示booleantrue
options高级参数WatermarkOptionsnull

高级参数

参数说明类型默认值
monitor是否开启保护模式booleantrue
mode展示模式,interval表示错行展示stringinterval
gapX水印之间的水平间距number100
gapY水印之间的垂直间距number100
offsetLeft水印在 canvas 画布上绘制的水平偏移量number0
offsetTop水印在 canvas 画布上绘制的垂直偏移量number0
width单个水印宽度number120
height单个水印高度number64
useClientHeight是否使用元素或者父元素的ClientHeightbooleanfalse
image图片源,建议导出 2 倍或 3 倍图,优先使用图片渲染水印string-
zIndex水印层级number9999
width单个水印宽度number120
height单个水印高度number64
opacity水印透明度number0.15
rotate旋转的角度number-22
fontSize设置字体大小number16
fontWeight设置字体粗细number | stringnormal
fontStyle规定字体样式stringnormal
fontVariant规定字体变体stringnormal
fontColor设置字体颜色string#000
fontFamily设置水印文字的字体stringsans-serif

Keywords

watermark

FAQs

Package last updated on 09 Mar 2022

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