feat: add Badge component #6573

This commit is contained in:
chenjiahan
2020-10-02 16:46:57 +08:00
parent f75c8231c6
commit 475e60b282
17 changed files with 336 additions and 46 deletions
+5 -3
View File
@@ -31,7 +31,10 @@ export default createComponent({
const isImageIcon = isImage(name);
return (
<tag
<Badge
dot={dot}
tag={tag}
content={badge}
class={[classPrefix, isImageIcon ? '' : `${classPrefix}-${name}`]}
style={{
color,
@@ -40,8 +43,7 @@ export default createComponent({
>
{slots.default?.()}
{isImageIcon && <img class={bem('image')} src={name} />}
<Badge dot={dot} badge={badge} />
</tag>
</Badge>
);
};
},