Skip to content

CubicBezier 贝塞尔曲线 0.3.0

可用于加入购物车动画。

左下方动画

通过 left 属性设置购物车(终点)中心位置 left 值,bottom 属性设置购物车(终点)中心位置 bottom 值,param 属性为自定义参数,@click 事件为点击目标元素开始执行动画。

html
<wui-cell title="点击加号加入购物车" center>
  <view class="cubic-bezier-right">
    <wui-cubic-bezier :navbar="false" :left="left" :bottom="bottom" :param="0" @click="handleClick">
      <wui-icon name="add-circle" size="22px"></wui-icon>
      <template v-slot:badge>
        <view class="wui-badge">1</view>
      </template>
    </wui-cubic-bezier>
  </view>
</wui-cell>
js
//data数据
left: 116,
bottom: 140

右下方动画

通过 direction 属性设置动画方向, right 属性设置购物车(终点)中心位置 right 值,bottom 属性设置购物车(终点)中心位置 bottom 值,param 属性为自定义参数,@click 事件为点击目标元素开始执行动画。

html
<wui-cell title="点击加号加入购物车" center>
  <view class="cubic-bezier-right">
    <wui-cubic-bezier direction="rb" :navbar="false" :right="right" :bottom="bottom" :param="0" @click="handleClick">
      <wui-icon name="add-circle" size="22px"></wui-icon>
      <template v-slot:badge>
        <view class="wui-badge">1</view>
      </template>
    </wui-cubic-bezier>
  </view>
</wui-cell>
js
//data数据
right: 100,
bottom: 140

Attributes

参数说明类型可选值默认值最低版本
direction动画方向stringrt(右上)、rb(右下)、lb(左下)、lt(左上)lb0.3.0
top购物车(终点)中心位置 top 值,单位 rpx,direction 值为 rt,lt 时传值number / string-1000.3.0
bottom购物车(终点)中心位置 bottom 值,单位 rpx,direction 值为 rb,lb 时传值number / string-1000.3.0
left购物车(终点)中心位置 left 值,单位 rpx,direction 值为 lb,lt 时传值number / string-600.3.0
right购物车(终点)中心位置 right 值,单位 rpx,direction 值为 rt,rb 时传值number / string-600.3.0
navbar页面是否使用了原生导航栏,使用了自定义导航栏时传 falseboolean-true0.3.0
param自定义参数number / string-00.3.0

Events

事件名称说明参数最低版本
click点击目标(加号等)元素时触发{param:自定义参数}0.3.0

Slots

name说明最低版本
default目标(点击)元素0.3.0
badge动画元素0.3.0

源代码

文档
组件

Released under the MIT License.

Released under the MIT License.