mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Tag): incorrect border color when using plain (#8601)
* fix(Tag): incorrect border color when using plain * fix: snapshot
This commit is contained in:
parent
ed83922042
commit
f0eb0d18f0
@ -36,6 +36,7 @@ export default defineComponent({
|
|||||||
if (props.plain) {
|
if (props.plain) {
|
||||||
return {
|
return {
|
||||||
color: props.textColor || props.color,
|
color: props.textColor || props.color,
|
||||||
|
borderColor: props.color,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
&--plain {
|
&--plain {
|
||||||
background-color: @tag-plain-background-color;
|
background-color: @tag-plain-background-color;
|
||||||
|
border-color: currentColor;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -59,7 +60,8 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
border: 1px solid currentColor;
|
border: 1px solid;
|
||||||
|
border-color: inherit;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
content: '';
|
content: '';
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
@ -204,7 +204,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
<div class="van-cell__value">
|
<div class="van-cell__value">
|
||||||
<transition-stub>
|
<transition-stub>
|
||||||
<span style="color: rgb(114, 50, 221);"
|
<span style="color: rgb(114, 50, 221); border-color: #7232dd;"
|
||||||
class="van-tag van-tag--plain van-tag--default"
|
class="van-tag van-tag--plain van-tag--default"
|
||||||
>
|
>
|
||||||
Tag
|
Tag
|
||||||
|
@ -4,3 +4,12 @@ exports[`should hide tag when the show prop is false 1`] = `
|
|||||||
<transition-stub>
|
<transition-stub>
|
||||||
</transition-stub>
|
</transition-stub>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`should render border-color correctly 1`] = `
|
||||||
|
<transition-stub>
|
||||||
|
<span style="color: blue; border-color: red;"
|
||||||
|
class="van-tag van-tag--plain van-tag--default"
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
</transition-stub>
|
||||||
|
`;
|
||||||
|
@ -36,3 +36,15 @@ test('should not trigger click event when clicking the close icon', () => {
|
|||||||
wrapper.trigger('click');
|
wrapper.trigger('click');
|
||||||
expect(onClick).toHaveBeenCalledTimes(1);
|
expect(onClick).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should render border-color correctly', () => {
|
||||||
|
const wrapper = mount(Tag, {
|
||||||
|
props: {
|
||||||
|
plain: true,
|
||||||
|
color: 'red',
|
||||||
|
textColor: 'blue',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(wrapper.html()).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user