antvis / antvis.github.io

🔜 AntV 新站点!
https://antv.vision
Other
419 stars 51 forks source link

一些细节问题 #27

Closed afc163 closed 4 years ago

afc163 commented 4 years ago
afc163 commented 4 years ago
  let lefttop1Display = 'block';
  let lefttop2Display = 'none';
  if (!props.title) {
    lefttop1Display = 'none';
    lefttop2Display = 'block';
  }
  1. 可以直接 const lefttop1Display = props.title ? 'none' : 'block';
  2. lefttop1Display 这个变量如果不是多处使用,不需要有,直接把 props.title ? 'none' : 'block' 字面量写到用的地方。
afc163 commented 4 years ago
afc163 commented 4 years ago
afc163 commented 4 years ago