mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
[improvement] Tag: add color prop (#1946)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
}), {
|
||||
'van-hairline--surround': plain
|
||||
}]"
|
||||
:style="style"
|
||||
>
|
||||
<slot />
|
||||
</span>
|
||||
@@ -17,10 +18,23 @@ import create from '../utils/create';
|
||||
|
||||
export default create({
|
||||
name: 'tag',
|
||||
|
||||
props: {
|
||||
type: String,
|
||||
mark: Boolean,
|
||||
color: String,
|
||||
plain: Boolean
|
||||
},
|
||||
|
||||
computed: {
|
||||
style() {
|
||||
if (this.color) {
|
||||
const key = this.plain ? 'color' : 'backgroundColor';
|
||||
return {
|
||||
[key]: this.color
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user