From 5f3fdfc7983d0a76dfe0565a48d23053e0b30598 Mon Sep 17 00:00:00 2001 From: jiaming743 <743192023@qq.com> Date: Tue, 16 Jun 2020 14:06:12 +0800 Subject: [PATCH] add number formatter --- src/components/digitalFlop/src/main.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/digitalFlop/src/main.vue b/src/components/digitalFlop/src/main.vue index d9da357..b767267 100644 --- a/src/components/digitalFlop/src/main.vue +++ b/src/components/digitalFlop/src/main.vue @@ -67,6 +67,11 @@ export default { fontSize: 30, fill: '#3de7c9' }, + /** + * @description Number formatter + * @type {Null|Function} + */ + formatter: undefined, /** * @description CRender animationCurve * @type {String} @@ -130,7 +135,7 @@ export default { }) }, getShape () { - const { number, content, toFixed, textAlign, rowGap } = this.mergedConfig + const { number, content, toFixed, textAlign, rowGap, formatter } = this.mergedConfig const [w, h] = this.renderer.area @@ -144,7 +149,8 @@ export default { content, toFixed, position, - rowGap + rowGap, + formatter } }, getStyle () {