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