diff --git a/src/switch-cell/test/__snapshots__/demo.spec.js.snap b/src/switch-cell/test/__snapshots__/demo.spec.js.snap
index ae0ddee04..70a597bc1 100644
--- a/src/switch-cell/test/__snapshots__/demo.spec.js.snap
+++ b/src/switch-cell/test/__snapshots__/demo.spec.js.snap
@@ -33,7 +33,7 @@ exports[`renders demo correctly 1`] = `
diff --git a/src/switch/index.js b/src/switch/index.js
index c9b1e02d7..a705ef5dd 100644
--- a/src/switch/index.js
+++ b/src/switch/index.js
@@ -1,6 +1,5 @@
// Utils
import { createNamespace, addUnit } from '../utils';
-import { BLUE } from '../utils/constant';
import { switchProps } from './shared';
// Mixins
@@ -42,10 +41,7 @@ export default createComponent({
genLoading() {
if (this.loading) {
- const color = this.checked
- ? this.activeColor || BLUE
- : this.inactiveColor || '';
-
+ const color = this.checked ? this.activeColor : this.inactiveColor;
return ;
}
},
diff --git a/src/switch/index.less b/src/switch/index.less
index b3b8c88db..8baa7a43a 100644
--- a/src/switch/index.less
+++ b/src/switch/index.less
@@ -41,6 +41,10 @@
.van-switch__node {
transform: translateX(@switch-width - @switch-node-size);
}
+
+ .van-switch__loading {
+ color: @switch-on-background-color;
+ }
}
&--disabled {
diff --git a/src/switch/test/__snapshots__/demo.spec.js.snap b/src/switch/test/__snapshots__/demo.spec.js.snap
index a47434536..c05490ce5 100644
--- a/src/switch/test/__snapshots__/demo.spec.js.snap
+++ b/src/switch/test/__snapshots__/demo.spec.js.snap
@@ -15,7 +15,7 @@ exports[`renders demo correctly 1`] = `