npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-blind-watermark

v1.0.0

Published

A Vue component for adding blind watermarks to web pages

Readme

Vue Blind Watermark

一个简单易用的Vue盲水印组件,可以为网页添加不易察觉的水印,保护敏感信息。

特性

  • 简单易用,一行代码即可集成
  • 支持自定义工号、日期等水印内容
  • 可调整水印透明度、大小、间距等参数
  • 防篡改机制,自动检测并恢复被修改的水印
  • 支持Vue 2

安装

npm install vue-blind-watermark --save
# 或
yarn add vue-blind-watermark

使用方法

全局注册

import Vue from 'vue'
import VueBlindWatermark from 'vue-blind-watermark'

Vue.use(VueBlindWatermark)

局部注册

import { BlindWatermark } from 'vue-blind-watermark'

export default {
  components: {
    BlindWatermark
  }
}

基本用法

<template>
  <div>
    <blind-watermark work-id="220909" :opacity="0.01"></blind-watermark>
    <!-- 页面内容 -->
  </div>
</template>

属性

| 属性名 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | workId | String | '' | 工号或其他标识 | | opacity | Number | 0.01 | 水印透明度,范围0-1 | | textColor | String | 'rgba(0, 0, 0, 0.6)' | 水印文本颜色 | | fontSize | Number | 14 | 水印文本大小(px) | | spacing | Number | 80 | 水印间距(px) | | horizontalSpacing | Number | 80 | 水印水平间距(px),优先级高于spacing | | verticalSpacing | Number | 44 | 水印垂直间距(px),优先级高于spacing | | lineSpacing | Number | 2 | 水印文本行间距(px) | | size | Number | 170 | 水印大小(px) | | customText | String | '' | 自定义水印文本 | | showDate | Boolean | true | 是否显示日期 | | zIndex | Number | 1000 | 水印层级 |

事件

| 事件名 | 说明 | 回调参数 | |--------|------|----------| | watermark-generated | 水印生成完成时触发 | 水印内容文本 |

示例

自定义水印内容和样式

<template>
  <div>
    <blind-watermark 
      work-id="员工编号: 220909"
      custom-text="公司机密"
      :opacity="0.02"
      :font-size="16"
      :spacing="100"
      :horizontal-spacing="100"
      :vertical-spacing="50"
      :line-spacing="1"
      text-color="rgba(255, 0, 0, 0.5)"
      @watermark-generated="onWatermarkGenerated"
    ></blind-watermark>
    <!-- 页面内容 -->
  </div>
</template>

<script>
export default {
  methods: {
    onWatermarkGenerated(text) {
      console.log('水印已生成:', text)
    }
  }
}
</script>

调整水印间距

<template>
  <div>
    <!-- 使用不同的水平和垂直间距,使水印分布更加紧凑 -->
    <blind-watermark 
      work-id="220909"
      :horizontal-spacing="80"
      :vertical-spacing="40"
      :opacity="0.01"
    ></blind-watermark>
    <!-- 页面内容 -->
  </div>
</template>

注意事项

  • 水印透明度建议保持在0.01-0.05之间,过高会影响用户体验,过低则可能无法达到防泄密效果
  • 水印会覆盖整个页面,但不会影响页面交互(pointer-events: none)

许可证

MIT