Commit 2203e4a0 authored by leon's avatar leon

feat:CountTo and NumberScroll add new config

parent e510c83f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="count-to" :style="{height: `${height}px`,}"> <view class="count-to" :style="{height: `${height}px`,}">
<NormalTitle :elementInfo="elementInfo"></NormalTitle> <NormalTitle :elementInfo="elementInfo"></NormalTitle>
<!-- warning:count-to的font-size单位为rpx --> <!-- warning:count-to的font-size单位为rpx -->
<u-count-to :start-val="startVal" :end-val="endVal" separator="," :color="elementInfo.option.countTo.color" :font-size="getFontSize()"></u-count-to> <u-count-to :start-val="startVal" :end-val="endVal" :duration="duration" separator="," :color="elementInfo.option.countTo.color" :font-size="getFontSize()"></u-count-to>
</view> </view>
</template> </template>
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
return { return {
startVal: 0, startVal: 0,
endVal: 0, endVal: 0,
height: 0 height: 0,
duration: 2000
}; };
}, },
...@@ -28,6 +29,9 @@ ...@@ -28,6 +29,9 @@
this.$nextTick(() => { this.$nextTick(() => {
this.startVal = this.endVal this.startVal = this.endVal
this.endVal = this.elementData.dataList.endVal this.endVal = this.elementData.dataList.endVal
if(this.elementInfo.option.countTo.duration) {
this.duration = this.elementInfo.option.countTo.duration * 1000
}
}) })
}, },
// 计算组件高度 // 计算组件高度
......
<template> <template>
<view class="chart-num" :style="{height: `${height}px`,}"> <view class="chart-num" :style="{height: `${height}px`,'margin-top': `${elementInfo.option.title.titleMarginTop}px`}">
<!-- <BasicText :elementInfo="elementInfo"></BasicText> --> <!-- <BasicText :elementInfo="elementInfo"></BasicText> -->
<NormalTitle :elementInfo="elementInfo"></NormalTitle> <NormalTitle :elementInfo="elementInfo"></NormalTitle>
<ul class="box-item marginTop20"> <ul class="box-item marginTop20">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment