From 840fd8ef9c29204d705874a2346fb38edf5896ea Mon Sep 17 00:00:00 2001 From: jiaming743 <743192023@qq.com> Date: Wed, 9 Sep 2020 17:12:51 +0800 Subject: [PATCH] add unit config --- src/components/activeRingChart/src/main.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/activeRingChart/src/main.vue b/src/components/activeRingChart/src/main.vue index 00f543f..9ea374e 100644 --- a/src/components/activeRingChart/src/main.vue +++ b/src/components/activeRingChart/src/main.vue @@ -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