Browse Source

默认值

liushengqiang 2 năm trước cách đây
mục cha
commit
797ba0fd11
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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>
               )
             })}