浏览代码

默认值

liushengqiang 2 年之前
父节点
当前提交
797ba0fd11
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/views/subject-echarts/index.tsx

+ 2 - 2
src/views/subject-echarts/index.tsx

@@ -358,9 +358,9 @@ export default defineComponent({
           <div class={styles.headLabelWrap}>
             {activeData.colors.map((c, cIndex) => {
               return (
-                <div class={styles.headLabel} style={{display: c.select && activeData.sum[c.key] ? '' : 'none'}}>
+                <div class={styles.headLabel} style={{display: c.select ? '' : 'none'}}>
                   <div class={styles.headLabelDot} style={{background: c.color, color: c.color}}></div>
-                  <div style={{color: c.color}}>{activeData.sum[c.key]}{cIndex === 0 ? '%' : '人'}</div>
+                  <div style={{color: c.color}}>{activeData.sum[c.key] || 0}{cIndex === 0 ? '%' : '人'}</div>
                 </div>
               )
             })}