vue.js 登录界面_vue.js的可刷卡界面

vue.js 登录界面

VueSwing (VueSwing)

A Vue.js wrapper for Swing. Swing is a swipeable cards interface. The swipe-left/swipe-right for yes/no input. As seen in apps like Jelly and Tinder, and many others.

Swing的Vue.js包装器。 Swing是可滑动刷卡的界面。 向左/向右滑动可输入是/否。 正如在Jelly和Tinder等应用程序中看到的那样。

Swing

正在安装 (Installing)

npm install --save vue-swing

用法 (Usage)

import VueSwing from 'vue-swing'

Vue.component('vue-swing', VueSwing)
<vue-swing
  @throwout="throwout"
  @throwin="throwin"
  :config="config"
>
  <div class="box">Throw me!</div>
</vue-swing>

物产 (Properties)

VueSwing takes in one config Object, which can consist of any of these keys:

VueSwing接受一个config对象,该对象可以包含以下任何一个键:

NameDescriptionDefault
isThrowOutInvoked in the event of dragend. Determines if element is being thrown out of the stack.Element is considered to be thrown out when throwOutConfidence is equal to 1.
allowedDirectionsArray of directions in which cards can be thrown out.[VueSwing.Direction.DOWN, VueSwing.Direction.LEFT, VueSwing.Direction.RIGHT, VueSwing.Direction.UP].
throwOutConfidenceInvoked in the event of dragmove. Returns a value between 0 and 1 indicating the completeness of the throw out condition.Ration of the absolute distance from the original card position and element width.
throwOutDistanceInvoked when card is added to the stack. The card is thrown to this offset from the stack.The value is a random number between minThrowOutDistance and maxThrowOutDistance.
minThrowOutDistanceIn effect when throwOutDistance is not overwritten.450.
maxThrowOutDistanceIn effect when throwOutDistance is not overwritten.500.
rotationInvoked in the event of dragmove. Determine the rotation of the element.Rotation is equal to the proportion of horizontal and vertical offset times the maximumRotation constant.
maxRotationIn effect when rotation is not overwritten.20.
transformInvoked in the event of dragmove and every time the physics solver is triggered.Uses CSS transform to translate element position and rotation.
名称 描述 默认
isThrowOut dragend的情况下调用。 确定是否将元素抛出堆栈。 throwOutConfidence等于1时,认为元素被抛出。
allowedDirections 可以抛出卡片的方向数组。 [VueSwing.Direction.DOWN,VueSwing.Direction.LEFT,VueSwing.Direction.RIGHT,VueSwing.Direction.UP]。
throwOutConfidence dragmove调用。 返回0到1之间的值,指示抛出条件的完整性。 距原始卡片位置和元素宽度的绝对距离的比率。
throwOutDistance 将卡添加到堆栈中时调用。 卡被从堆栈中抛出此偏移量。 该值是介于minThrowOutDistancemaxThrowOutDistance之间的随机数。
minThrowOutDistance throwOutDistance不被覆盖时throwOutDistance 450。
maxThrowOutDistance throwOutDistance不被覆盖时throwOutDistance 500
rotation dragmove调用。 确定元素的旋转。 旋转等于水平和垂直偏移的比例乘以maximumRotation常数。
maxRotation rotation不被覆盖时有效。 20
transform dragmove和每次触发物理求解器时调用。 使用CSS变换来转换元素的位置和旋转。

翻译自: https://vuejsexamples.com/a-swipeable-cards-interface-with-vue-js/

vue.js 登录界面

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值