1.5.1 • Published 1 year ago

@wines/circle v1.5.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

@wines/circle

Circle 进度环

用于展现某个任务的当前进度。

使用指南

在 page.json 中引入组件

{
  "navigationBarTitleText": "Circle",
  "usingComponents": {
    "wux-button": "@wines/button",
    "wux-circle": "@wines/circle"
  }
}

示例

<view class="page">
	<view class="page__hd">
		<view class="page__title">Circle</view>
		<view class="page__desc">进度环</view>
	</view>
	<view class="page__bd page__bd_spacing">
		<view class="sub-title">Color</view>
		<wux-circle percent="80" color="#33cd5f">#33cd5f</wux-circle>
		<view class="sub-title">BackgroundColor</view>
		<wux-circle percent="80" background-color="#ef473a">#ef473a</wux-circle>
		<view class="sub-title">Other</view>
		<wux-circle percent="{{ percent }}">{{ percent + '%' }}</wux-circle>
		<wux-button block type="light" bind:click="add">Add</wux-button>
	</view>
</view>
Page({
  data: {
    percent: 50,
  },
  add() {
    let percent = this.data.percent + 10;
    if (this.data.percent >= 100) {
      percent = 0;
    }
    this.setData({
      percent,
    });
  },
});

API

Circle props

参数类型描述默认值
prefixClsstring自定义类名前缀wux-circle
percentnumber百分比 0~1000
sizenumber进度环的尺寸,单位 px120
strokeWidthnumber进度环的宽度,单位 px10
lineCapstring进度环的线头样式,可选值为 square、round、buttround
backgroundColorstring默认背景颜色#f3f3f3
colorstring默认前景颜色#33cd5f
sAnglenumber进度环动画的开始角度(在3点钟方向)0
counterclockwiseboolean设置圆形进度条是顺时针旋转,还是逆时针旋转。true 表示逆时针旋转,false 表示顺时针旋转。false
speednumber进度环的动画速度2000
animateboolean进度环动画是否执行平滑动画效果true
backgroundboolean是否显示进度环的运动轨迹true
bind:changefunction每一个动画帧之后的回调函数-

Circle slot

名称描述
-自定义内容

Circle externalClasses

名称描述
wux-class根节点样式类
1.5.1

1 year ago

1.5.0

1 year ago

1.3.5

2 years ago

1.4.0

2 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago