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

captcha-slide

v0.0.1

Published

图片滑动验证

Downloads

4

Readme

滑块验证插件

使用方法

  1. 组件内部使用:
    html:
       <captcha-slide/>
    js:
    import CaptchaSlide from 'captcha-slide'
    components: {
      CaptchaSlide
    }
  1. main.js 全局安装:
    import CaptchaSlide from 'captcha-slide'
    Vue.use(CaptchaSlide)
  1. 直接引用打包后的 captcha-slide.js 并html全局使用 (包括cdn引用):
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
</head>
<body>
<div id="app">
  <captcha-slide @success="onSuccess"></captcha-slide>
</div>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="./dist/captcha-slide.js"></script>
<script>
  new Vue({
    el: '#app',
    data: function() {
      return {
      }
    },
    methods: {
        onSuccess() {  
          // 成功回调
        }
    }
  })
</script>
</body>
</html>
  1. CDN引用,vue局部使用 (开发环境需要代理) --推荐:

全局注册(无法异步加载):

index.html 引用:
<script src="./dist/captcha-slide.js"></script>
注册:
<script>
  if (window['captcha-slide']) {
    Vue.use(window['captcha-slide'].default)
  }
</script>

局部注册(推荐):

index.html 引用(异步):
<script src="./dist/captcha-slide.js" defer></script>
注册:
<template>
  <captcha-slide moduleId="testModule" @success="onSuccess"></captcha-slide>
</template>
<script>
  export default {
    components: {
    // 即使滑块插件下载失败也不会影响其它模块
    captchaSlide: window['captcha-slide'] ? window['captcha-slide'].default : null
  },
  }
</script>

组件属性

props:

  1. moduleId {type: String, default: 'default'}: 调用滑块的模块id
  2. sliderText {type: String, default: '向右滑动'}: 滑动提示文字
  3. show {type: Boolean, default: true}: 右上角是否显示刷新按钮
  4. refreshIfFail {type: Boolean, default: true}: 验证失败后是否刷新图片

event:

  1. @success() : 验证成功回调函数

接口代理

/ecp-tools-backend/slider 代理到 http://dev.web.ckmooc.com