add showOriginValue configuration

This commit is contained in:
jiaming743 2020-05-06 14:13:34 +08:00
parent c98ca00179
commit 22c88c4ea5
1 changed files with 6 additions and 6 deletions

View File

@ -96,11 +96,11 @@ export default {
*/
animationFrame: 50,
/**
* @description CRender showOriginalValue
* @description showOriginValue
* @type {Boolean}
* @default showOriginalValue = false
* @default showOriginValue = false
*/
showOriginalValue: false
showOriginValue: false
},
mergedConfig: null,
@ -122,14 +122,14 @@ export default {
digitalFlopStyle,
digitalFlopToFixed,
data,
showOriginalValue
showOriginValue
} = mergedConfig
const value = data.map(({ value }) => value)
let displayValue
if (showOriginalValue) {
if (showOriginValue) {
displayValue = value[activeIndex]
} else {
const sum = value.reduce((all, v) => all + v, 0)
@ -140,7 +140,7 @@ export default {
}
return {
content: showOriginalValue ? '{nt}' : '{nt}%',
content: showOriginValue ? '{nt}' : '{nt}%',
number: [displayValue],
style: digitalFlopStyle,
toFixed: digitalFlopToFixed