1
This commit is contained in:
25
uview-plus/components/u-count-to/countTo.js
Normal file
25
uview-plus/components/u-count-to/countTo.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* @Author : LQ
|
||||
* @Description :
|
||||
* @version : 1.0
|
||||
* @Date : 2021-08-20 16:44:21
|
||||
* @LastAuthor : LQ
|
||||
* @lastTime : 2021-08-20 16:57:32
|
||||
* @FilePath : /u-view2.0/uview-ui/libs/config/props/countTo.js
|
||||
*/
|
||||
export default {
|
||||
// countTo 组件
|
||||
countTo: {
|
||||
startVal: 0,
|
||||
endVal: 0,
|
||||
duration: 2000,
|
||||
autoplay: true,
|
||||
decimals: 0,
|
||||
useEasing: true,
|
||||
decimal: '.',
|
||||
color: '#606266',
|
||||
fontSize: 22,
|
||||
bold: false,
|
||||
separator: ''
|
||||
}
|
||||
}
|
||||
61
uview-plus/components/u-count-to/props.js
Normal file
61
uview-plus/components/u-count-to/props.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import { defineMixin } from '../../libs/vue'
|
||||
import defProps from '../../libs/config/props.js'
|
||||
export const props = defineMixin({
|
||||
props: {
|
||||
// 开始的数值,默认从0增长到某一个数
|
||||
startVal: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.countTo.startVal
|
||||
},
|
||||
// 要滚动的目标数值,必须
|
||||
endVal: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.countTo.endVal
|
||||
},
|
||||
// 滚动到目标数值的动画持续时间,单位为毫秒(ms)
|
||||
duration: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.countTo.duration
|
||||
},
|
||||
// 设置数值后是否自动开始滚动
|
||||
autoplay: {
|
||||
type: Boolean,
|
||||
default: () => defProps.countTo.autoplay
|
||||
},
|
||||
// 要显示的小数位数
|
||||
decimals: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.countTo.decimals
|
||||
},
|
||||
// 是否在即将到达目标数值的时候,使用缓慢滚动的效果
|
||||
useEasing: {
|
||||
type: Boolean,
|
||||
default: () => defProps.countTo.useEasing
|
||||
},
|
||||
// 十进制分割
|
||||
decimal: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.countTo.decimal
|
||||
},
|
||||
// 字体颜色
|
||||
color: {
|
||||
type: String,
|
||||
default: () => defProps.countTo.color
|
||||
},
|
||||
// 字体大小
|
||||
fontSize: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.countTo.fontSize
|
||||
},
|
||||
// 是否加粗字体
|
||||
bold: {
|
||||
type: Boolean,
|
||||
default: () => defProps.countTo.bold
|
||||
},
|
||||
// 千位分隔符,类似金额的分割(¥23,321.05中的",")
|
||||
separator: {
|
||||
type: String,
|
||||
default: () => defProps.countTo.separator
|
||||
}
|
||||
}
|
||||
})
|
||||
189
uview-plus/components/u-count-to/u-count-to.vue
Normal file
189
uview-plus/components/u-count-to/u-count-to.vue
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user