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 🙏

© 2024 – Pkg Stats / Ryan Hefner

am-watermark

v1.0.1

Published

一款Vue3的水印组件、支持指令和组件使用

Downloads

6

Readme

Vue 3 WaterMark

一款 Vue3 的水印组件,支持组件使用和指令使用两种方式。

安装

npm i am-watermark

用法

main.js 引入组件和样式,将会自动注册组件和指令两种使用方式,不要忘记导入样式。

import WaterMark from 'am-watermark'
import 'am-watermark/dist/style.css'

createApp(App).use(WaterMark).mount('#app')

1、通过组件

<template>
  <div>
    <WaterMark text="水印文字" :options="options">
      <div>这是一个水印组件</div>
    </WaterMark>
  </div>
</template>

2、通过指令

使用指令方式会改变您的 DOM 结构,在外层增加一层 DIV,如果您的样式有问题,请使用组件方式

<template>
  <div
    v-watermark="{
      text: '水印文字',
      options,
    }"
  >
    <div>这是一个水印组件</div>
  </div>
</template>

参数

text

水印的文字,类型为字符串

options

| 参数 | 类型 | 描述 | 默认值 | | ---------- | ------ | ---------------------------------------- | --------------- | | width | number | 宽度 | 120 | | height | number | 高度 | 64 | | fontSize | number | 文字大小 | 16 | | fontFamily | string | 文字家族 | Arial | | fontColor | string | 文字颜色 | rgba(0,0,0,0.3) | | fontWight | number | 文字粗细 | 400 | | offsetLeft | number | 左侧偏移 | 0 | | offsetTop | number | 顶部偏移 | 0 | | gapX | number | 水平间距 | 0 | | gapY | number | 垂直间距 | 0 | | rotate | number | 旋转角度 | 0 | | zIndex | number | 内容层级,可以改变大小调整在水印上方/下方 | 10 |