mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 11:54:02 +00:00
fix(Button): should hide border when color is linear-gradient (#4342)
This commit is contained in:
@@ -57,16 +57,22 @@ function Button(
|
||||
loadingText
|
||||
} = props;
|
||||
|
||||
const style: Record<string, string> = {};
|
||||
const style: Record<string, string | number> = {};
|
||||
|
||||
if (color) {
|
||||
style.borderColor = color;
|
||||
style.color = plain ? color : WHITE;
|
||||
|
||||
if (!plain) {
|
||||
// Use background instead of backgroundColor to make linear-gradient work
|
||||
style.background = color;
|
||||
}
|
||||
|
||||
// hide border when color is linear-gradient
|
||||
if (color.indexOf('gradient') !== -1) {
|
||||
style.border = 0;
|
||||
} else {
|
||||
style.borderColor = color;
|
||||
}
|
||||
}
|
||||
|
||||
function onClick(event: Event) {
|
||||
|
Reference in New Issue
Block a user