注册全局组件 vue.js_vue.js验证组件,用于登录或注册

注册全局组件 vue.js

Vue拖动验证 (vue-drag-verify)

This is a vue component, which is sliding to unlock some functionalities, such as login or sign up. This is used to protect your web app from attack.

这是一个Vue组件,可以滑动以解锁某些功能,例如登录或注册。 这用于保护您的Web应用程序免受攻击。

安装 (Installation)

npm install vue-drag-verify --save

用法 (Usage)

<drag-verify :width="width" 
			 :height="height" 
			 :text="text" 
			 :success-text="successText" 
			 :background="background" 
			 :progress-bar-bg="progressBarBg" 
			 :completed-bg="completedBg" 
			 :handler-bg="handlerBg" 
			 :handler-icon="handlerIcon" 
			 :text-size="textSize" 
			 :success-icon="successIcon" 
			 :circle="getShape"></drag-verify>
import Vue from 'vue'
import dragVerify from 'vue-drag-verify'

export default {
  name: 'app',
  components:{
    dragVerify
  }
}

道具 (Props)

PropertyTypeDefaultDescription
widthNumber200The width of the component
heightNumber60The height of the component
textStringswiping to the right sideThe text shows on the component
successTextStringsuccessThe text shows when it’s successful
backgroundString#cccThe background color of the component
colorString#ffffffThe color of the text
progressBarBgString#FFFF99The backgound color of the progress bar
completedBgString#66cc66The backgound color of the component when the button dragged to the right side
circleBooleantrueIf true, the shape of component is round
handlerIconString-The icon of handler
successIconString-The icon of handler when the button dragged to the right side
handlerBgString#fffThe background color of the handler
textSizeString20pxFont size of prompt message
属性 类型 默认 描述
宽度 200 组件的宽度
高度 60 组件的高度
文本 向右滑动 文本显示在组件上
successText 成功 文字显示成功的时间
背景 #ccc 组件的背景色
颜色 #ffffff 文字颜色
progressBarBg #FFFF99 进度条的背景色
已完成 #66cc66 当按钮拖动到右侧时组件的背景色
布尔型 真正 如果为true,则组件的形状为圆形
handlerIcon -- 处理程序的图标
successIcon -- 按钮拖动到右侧时的处理程序图标
handlerBg #fff 处理程序的背景色
字体大小 20像素 提示消息的字体大小

事件 (Event)

回叫 (passcallback)

Emitted when pass verify, the handler dragged to the right side.

通过验证时发出,处理程序拖到右侧。

翻译自: https://vuejsexamples.com/a-vue-js-verification-component-for-login-or-sign-up/

注册全局组件 vue.js