chore: optional chaining (#8283)

This commit is contained in:
neverland
2021-03-05 11:05:27 +08:00
committed by GitHub
parent 391ccd4240
commit 09e1eb5a0d
7 changed files with 24 additions and 47 deletions
+5 -3
View File
@@ -388,9 +388,11 @@ export default createComponent({
const renderDot = (_: number, index: number) => {
const active = index === activeIndicator.value;
const style: CSSProperties = {
backgroundColor: active ? props.indicatorColor : undefined,
};
const style = active
? {
backgroundColor: props.indicatorColor,
}
: undefined;
return <i style={style} class={bem('indicator', { active })} />;
};