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

cmsk-fontend-libs

v0.1.20

Published

验证码组件

Downloads

3

Readme

cmsk-fontend-libs

城科前端组件管理仓库

使用

安装

npm i cmsk-fontend-libs // or yarn add cmsk-fontend-libs

vue 中使用

全局安装方式 (不推荐)

import Vue from 'vue'
import Verify from 'cmsk-fontend-libs'
Vue.use(Verify)

局部安装

import {SliderCaptcha, ClickWordCaptcha} from 'cmsk-fontend-libs'

组件介绍

拖拽图形验证码 (SliderCaptcha) 和 文字点击确认验证码(ClickWordCaptcha)

<SliderCaptcha
  v-model="verifyVisible"
  :imageInfo="imageInfo"
  :imgSize="{width: '90%', height: 140}"
  :checkTips="checkTips"
  :check-status="checkStatus"
  :refresh="getPictrue"
  @success="successHandle"
  @actionEnd="handleActionEnd"
  @checkStatusChange="checkStatusChange"
  ref="verify"
></SliderCaptcha>

tips: 适应移动端, imgSize: 可传百分比,根据文档document.body宽度计算 pc建议尺寸: 400, 200

接入方式,可参考 examples/App.vue

  • 需要生成客户端uuid,用于服务端通信
  • 获取图片验证码相关的信息,此处自己完成接口
  • 根据组件响应的不同事件完成相关的动作
 refresh   // 此参数,需要获取验证码图片信息
 actionEnd // 拖拽验证码 此为松开鼠标时的事件  点击文字验证此为点击数等于默认数时的事件 此时会响应对应的信息
           // 需要调用校验接口进行数据校验,校验成功需要改变组件的检验状态 checkStatus 
           // 此处有三种状态 'waiting', 'success', 'error'

 success // 成功后的回调
 checkStatusChange // 响应校验状态的改变并保存

暴露的类型

参考源码 src/@types

参数

// SliderCaptcha
  // 验证码出现类型 pop=>弹窗 fixed=>悬浮
  public mode: CaptchaPositionType
  // 验证码当前校验状态
  public checkStatus: CheckStatusType
  // 距离顶部或者底部的距离
  public vSpace: number
  // 滑块说明文字
  public explain: string
  // 验证提示文字
  public checkTips: string
  // 重新刷新的方法
  public refresh: () => void
  // 图片大小
  public imgSize: ImageSizeType
  // 图片信息
  public imageInfo: ImageInfoType
  // 滑块大小
  public blockSize: ImageSizeType
  // 滑道大小
  public barSize: ImageSizeType


// ClickWordCaptcha
    // 验证码出现类型 pop=>弹窗 fixed=>悬浮
    public mode: CaptchaPositionType
    // 验证码当前校验状态
    public checkStatus: CheckStatusType
    // 距离顶部或者底部的距离
    public vSpace: number
    // 滑块说明文字
    public explain: string
    // 重新刷新的方法
    public refresh: () => void
    // 图片大小
    public imgSize: ImageSizeType
    // 图片信息
    public imageInfo: ImageInfoType
    // 滑道大小
    public barSize: ImageSizeType