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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sf-verify2

v1.1.0

Published

基于 Vue2 的验证码组件库,支持滑块、点选等多种验证方式。

Readme

sf-verify2

一个功能强大的 Vue2 验证码组件库,提供多种验证方式,帮助开发者轻松实现网站安全验证功能。

主要特点

  • 基于 Vue2 开发,兼容 Vue 2.0.0 及以上版本
  • 支持多种验证方式:
    • 滑块验证
    • 点选验证
    • 更多验证方式持续开发中
  • 轻量级设计,易于集成
  • 提供完整的 TypeScript 类型支持
  • 支持按需引入,优化打包体积

安装

npm install sf-verify2

快速开始

全局注册

import Vue from 'vue'
import SfVerify2 from 'sf-verify2'

Vue.use(SfVerify2)

按需引入

import { SfVerify2 } from 'sf-verify2'

export default {
  components: {
    SfVerify2
  }
}

使用示例

<template>
  <SfVerify2
        ref="verify"
        :captchaType="'blockPuzzle'"
        :mode="'pop'"
        :imgSize="{width:'330px',height:'155px'}"
        :reqGet="customReqGet"
        :reqCheck="customReqCheck"
        @success="onSuccess"
      />
      <button @click="handleGetCode" class="verify-btn">获取验证码</button>
</template>

<script>
export default {
  methods: {
    onSuccess() {
      console.log('验证成功')
    },
    // pop  模式下,点击按钮显示验证码
      handleGetCode() {
      this.$refs.verify.show()
    },
    //  获取验证码信息 
     customReqGet(data) {
      return reqGet(data).then(res => {
        //接口成功获取数据仅支持repCode值为'0000'如果其它需要自定义添加repCode='0000' 
        if (res.repCode === '0000') {
          return res
        }
        return Promise.reject(new Error('获取验证码失败'))
      })
    },
    customReqCheck(data) {
      return reqCheck(data).then(res => {
        //接口成功获取数据仅支持repCode值为'0000'如果其它需要自定义添加repCode='0000' 
        console.log('验证结果:', res)
        return res
      })
    }
  }
}
</script>

API

服务端接口说明

参考https://github.com/anji-plus/captcha

Props

| 属性名 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | type | String | 'slide' | 验证类型,可选值:'slide'、'point' | | width | Number | 320 | 验证码组件宽度 | | height | Number | 160 | 验证码组件高度 | | theme | String | 'light' | 主题,可选值:'light'、'dark' |

Events

| 事件名 | 说明 | 回调参数 | |--------|------|----------| | success | 验证成功时触发 | - | | fail | 验证失败时触发 | - |

开发计划

  • [ ] 添加更多验证方式
  • [ ] 优化移动端体验
  • [ ] 提供更多自定义配置选项
  • [ ] 完善文档和示例

贡献指南

欢迎提交 Issue 和 Pull Request 来帮助改进这个项目。

许可证

MIT License