From 627bf2e63ce70963f2154faa02f713c6425b2549 Mon Sep 17 00:00:00 2001 From: xiaowen <372193233@qq.com> Date: Tue, 5 Jul 2022 18:43:49 +0800 Subject: [PATCH] no message --- src/mixins/index.js | 3 +++ src/views/BrandInsight/brandData/index.vue | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mixins/index.js b/src/mixins/index.js index d5d9226..172e562 100644 --- a/src/mixins/index.js +++ b/src/mixins/index.js @@ -221,6 +221,9 @@ export default { }, // 数字转化成金额 formatMoney(val, places, symbol, thousand, decimal) { + if(val === 0 || !val) { + return 0 + } places = !isNaN(places = Math.abs(places)) ? places : 2; symbol = symbol !== undefined ? symbol : "¥"; thousand = thousand || ","; diff --git a/src/views/BrandInsight/brandData/index.vue b/src/views/BrandInsight/brandData/index.vue index 2745453..e33590d 100644 --- a/src/views/BrandInsight/brandData/index.vue +++ b/src/views/BrandInsight/brandData/index.vue @@ -23,7 +23,7 @@ {{item.value}} - {{count}} + {{count|formatMoney(0,'',',')}}