1.5.1 • Published 1 year ago

@wines/progress v1.5.1

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

@wines/progress

Progress 进度条

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

使用指南

在 page.json 中引入组件

{
  "navigationBarTitleText": "Progress",
  "usingComponents": {
    "wux-white-space": "@wines/white-space",
    "wux-button": "@wines/button",
    "wux-progress": "@wines/progress"
  }
}

示例

<view class="page">
	<view class="page__hd">
		<view class="page__title">Progress</view>
		<view class="page__desc">进度条</view>
	</view>
	<view class="page__bd page__bd_spacing">
		<view class="sub-title">Status</view>
		<wux-progress status="normal" percent="50" />
		<wux-white-space/>
		<wux-progress status="progress" percent="50" />
		<wux-white-space/>
		<wux-progress status="error" percent="50" />
		<wux-white-space/>
		<wux-progress status="success" percent="50" />
		<view class="sub-title">ActiveColor</view>
		<wux-progress active-color="#11c1f3" percent="50" />
		<wux-white-space/>
		<wux-progress active-color="#ffc900" percent="50" />
		<wux-white-space/>
		<wux-progress active-color="#886aea" percent="50" />
		<view class="sub-title">BackgroundColor</view>
		<wux-progress background-color="#fff" percent="25" />
		<wux-white-space/>
		<wux-progress background-color="#f3f3f3" percent="50" />
		<wux-white-space/>
		<wux-progress background-color="#f8f8f8" percent="75" />
		<view class="sub-title">Shape</view>
		<wux-progress shape="square" percent="25" />
		<wux-white-space/>
		<wux-progress shape="square" percent="50" />
		<wux-white-space/>
		<wux-progress shape="square" percent="75" />
		<view class="sub-title">BarStyle</view>
		<wux-progress bar-style="background-color: #5cb85c" percent="25" />
		<wux-white-space/>
		<wux-progress bar-style="background-color: #5bc0de" percent="50" />
		<wux-white-space/>
		<wux-progress bar-style="background-color: #f0ad4e" percent="75" />
		<view class="sub-title">StrokeWidth</view>
		<wux-progress stroke-width="8" percent="25" />
		<wux-white-space/>
		<wux-progress stroke-width="10" percent="50" />
		<wux-white-space/>
		<wux-progress stroke-width="12" percent="75" />
		<view class="sub-title">ShowInfo</view>
		<wux-progress show-info percent="{{ percent }}" />
		<wux-progress show-info percent="{{ percent }}" />
		<wux-progress show-info percent="{{ percent }}" />
		<wux-button block type="light" bind:click="add">Add</wux-button>
	</view>
</view>
import './index.less';

Page({
  data: {
    percent: 50,
  },
  add() {
    let percent = this.data.percent + 10;

    if (this.data.percent >= 100) {
      percent = 0;
    }

    this.setData({
      percent,
    });
  },
});

API

Progress props

参数类型描述默认值
prefixClsstring自定义类名前缀wux-progress
percentnumber百分比 0~1000
strokeWidthstring进度条线的宽度,单位 px10
activeColorstring已选择的进度条的颜色,优先级高于 status 的默认颜色-
backgroundColorstring未选择的进度条的颜色#f3f3f3
barStylestring,object进度样式-
statusstring状态,可选值为 normal、progress、error、successnormal
shapestring形状,可选值为 round、squareround
showInfoboolean在进度条右侧显示百分比false

Progress 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