chore: migrate cell default slot (#8971)

This commit is contained in:
neverland
2021-07-02 16:29:19 +08:00
committed by GitHub
parent edb6ea8858
commit bc8bad0247
5 changed files with 33 additions and 26 deletions
+10 -5
View File
@@ -134,8 +134,17 @@ export default defineComponent({
}
};
const renderIcon = () => {
if (active) {
return (
<Icon class={bem('icon')} color={activeColor} name="success" />
);
}
};
return (
<Cell
v-slots={{ value: renderIcon }}
clickable
key={option.value}
icon={option.icon}
@@ -143,11 +152,7 @@ export default defineComponent({
class={bem('option', { active })}
style={{ color: active ? activeColor : '' }}
onClick={onClick}
>
{active && (
<Icon class={bem('icon')} color={activeColor} name="success" />
)}
</Cell>
></Cell>
);
};