add unit config

This commit is contained in:
jiaming743 2020-09-09 17:12:51 +08:00
parent baeafe243f
commit 840fd8ef9c
1 changed files with 8 additions and 2 deletions

View File

@ -83,6 +83,11 @@ export default {
* @type {Number}
*/
digitalFlopToFixed: 0,
/**
* @description Digital flop unit
* @type {String}
*/
digitalFlopUnit: '',
/**
* @description CRender animationCurve
* @type {String}
@ -122,7 +127,8 @@ export default {
digitalFlopStyle,
digitalFlopToFixed,
data,
showOriginValue
showOriginValue,
digitalFlopUnit
} = mergedConfig
const value = data.map(({ value }) => value)
@ -140,7 +146,7 @@ export default {
}
return {
content: showOriginValue ? '{nt}' : '{nt}%',
content: showOriginValue ? `{nt}${digitalFlopUnit}` : `{nt}${digitalFlopUnit || '%'}`,
number: [displayValue],
style: digitalFlopStyle,
toFixed: digitalFlopToFixed