From 339cbdc1ddc993f6b7eb0fb2bd03c3cd948ba263 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 27 Aug 2019 16:33:00 +0800 Subject: [PATCH] feat(Button): color prop support linear-gradient (#4252) --- src/button/index.tsx | 3 ++- src/button/test/__snapshots__/demo.spec.js.snap | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/button/index.tsx b/src/button/index.tsx index 6332b1a21..7d430d0ae 100644 --- a/src/button/index.tsx +++ b/src/button/index.tsx @@ -64,7 +64,8 @@ function Button( style.color = plain ? color : WHITE; if (!plain) { - style.backgroundColor = color; + // Use background instead of backgroundColor to make linear-gradient work + style.background = color; } } diff --git a/src/button/test/__snapshots__/demo.spec.js.snap b/src/button/test/__snapshots__/demo.spec.js.snap index bec3a605a..4a14d2b39 100644 --- a/src/button/test/__snapshots__/demo.spec.js.snap +++ b/src/button/test/__snapshots__/demo.spec.js.snap @@ -32,6 +32,6 @@ exports[`renders demo correctly 1`] = ` 迷你按钮
-
+
`;