更新记录
1.0.4(2025-07-11) 下载此版本
修复存在空白区域的bug
1.0.3(2025-07-11) 下载此版本
无
1.0.2(2025-07-11) 下载此版本
修复bug,使其兼容H5和APP端
查看更多平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | - | √ | - | √ | - | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
- | - | - | - | - | - | - | - | - | - | - |
其他
多语言 | 暗黑模式 | 宽屏模式 |
---|---|---|
× | × | √ |
hy-grid-progress 栅格式进度
描述
可自定义颜色、栅格数、间隙、高度、是否需要边框
仅测试于 vue2, H5. 其他平台可自行测试
使用方法
导入 `uni_modules` 后直接使用即可
<template>
<view class="container">
<hy-grid-progress :process="progress"></hy-grid-progress>
<hy-grid-progress :process="progress" beginColor="#f3a73f" endColor="#fdedd9" style="margin-top: 30px;"></hy-grid-progress>
<hy-grid-progress :process="progress" beginColor="#e43d33" endColor="#fad8d6" style="margin-top: 30px;"></hy-grid-progress>
<slider :value="progress" @change="onSliderChange" show-value />
</view>
</template>
<script>
export default {
data() {
return {
progress: 50
};
},
methods: {
onSliderChange(e) {
this.progress = e.detail.value
},
}
}
</script>
<style lang="scss">
.container {
height: 100vh;
background-color: #ffffff;
padding: 30px;
}
</style>
参数说明
参数 | 类型 | 默认值 | 说明 |
---|---|---|---|
process | Number | 50 | 进度 |
beginColor | String | #18bc37 | 起始点颜色,粗边框颜色 |
endColor | String | #8cde9b | 结束点颜色,细边框颜色 |
complementColor | String | #dcdcdc | 补充栅格颜色 |
gridNum | Number | 40 | 栅格数 |
gridHeight | String | 12px | 栅格高度,也可使用rpx,如24rpx |
gapWidth | String | 3px | 空隙宽度,默认3px,也可使用rpx,如6rpx |
hasBorder | Boolean | true | 是否需要边框 |
contentPadding | String | #5px | 内间距,默认5px,也可使用rpx,如10rpx |
thickBoderWith | String | 10px | 粗边框宽度 默认10px,也可使用rpx,如20rpx |
thickBoderHeight | Boolean | 6px | 粗边框高度 默认6px,也可使用rpx,如12rpx |