
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
watermark-vue3
Advanced tools
A lightweight Vue3 component for adding custom watermarks to web pages.
一个可以在网页中添加自定义水印的Vue3组件。
watermark-vue3是一个基于Vue3编写的用于在网页中添加自定义水印的轻量级组件。使用该组件,您可以自由设置水印文字、字体大小、字体、颜色、旋转角度、透明度、宽度和高度等参数,轻松实现水印效果。
通过npm安装:
npm install watermark-vue3
<template>
<Watermark :options="options" :visible="true"/>
</template>
<script setup lang="ts">
import Watermark from 'watermark-vue3';
const options = {
text: '我是水印',
fontSize: 14,
fontFamily: 'Microsoft YaHei',
color: 'rgba(0, 0, 0, 0.3)',
rotate: -30,
opacity: 0.5,
width: 200,
height: 100,
};
</script>
.watermark-wrap {
position: relative;
}
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| options | Object | 见下方默认值 | 水印设置,包括文字、字体大小、字体、颜色、旋转角度、透明度、宽度和高度等 |
| visible | Boolean | true | 是否显示水印 |
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| text | String | Array | '我是水印' | 水印文字,字符串或字符串数组 |
| fontSize | Number | 14 | 字体大小 |
| fontFamily | String | 'Microsoft YaHei' | 字体 |
| color | String | 'rgba(0, 0, 0, 0.3)' | 颜色 |
| rotate | Number | -30 | 旋转角度,单位为度数 |
| opacity | Number | 0.5 | 透明度 |
| width | Number | 200 | 宽度 |
| height | Number | 100 | 高度 |
<template>
<div class="watermark-wrap">
<img src="image.jpg" alt="">
<Watermark :options="options" :visible="true"/>
</div>
</template>
<script setup lang="ts">
import Watermark from 'watermark-vue3';
const options = {
text: ['仅供测试使用', '请勿商用'],
fontSize: 18,
fontFamily: 'Arial',
color: 'rgba(255, 0, 0, 0.2)',
rotate: -45,
opacity: 0.6,
width: 300,
height: 150,
};
</script>
<style scoped>
.watermark-wrap {
position: relative;
}
</style>
FAQs
A lightweight Vue3 component for adding custom watermarks to web pages.
The npm package watermark-vue3 receives a total of 3 weekly downloads. As such, watermark-vue3 popularity was classified as not popular.
We found that watermark-vue3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.