diff --git a/docs/examples-docs/switch.md b/docs/examples-docs/switch.md index aff5962fe..75f11bb1e 100644 --- a/docs/examples-docs/switch.md +++ b/docs/examples-docs/switch.md @@ -4,17 +4,29 @@ ```html
-
- -
{{switchStateText}}
-
-
- -
ON, DISABLED
-
-
- -
OFF, DISABLED
+

Switch

+

基础用法

+
+
+ +
{{switchStateText}}
+
+
+ +
ON, DISABLED
+
+
+ +
OFF, DISABLED
+
+
+ +
ON, LOADING
+
+
+ +
OFF, LOADING
+
diff --git a/docs/examples/switch.vue b/docs/examples/switch.vue index ce70ae6e5..87c399acf 100644 --- a/docs/examples/switch.vue +++ b/docs/examples/switch.vue @@ -5,17 +5,25 @@

基础用法

- +
{{switchStateText}}
- +
ON, DISABLED
- +
OFF, DISABLED
+
+ +
ON, LOADING
+
+
+ +
OFF, LOADING
+
diff --git a/packages/switch/src/switch.vue b/packages/switch/src/switch.vue index 1a26296ba..dc638ac84 100644 --- a/packages/switch/src/switch.vue +++ b/packages/switch/src/switch.vue @@ -1,6 +1,8 @@ @@ -18,7 +20,7 @@ * */ export default { - name: 'z-switch', + name: 'zan-switch', props: { checked: { type: Boolean, diff --git a/packages/zanui-css/src/switch.css b/packages/zanui-css/src/switch.css index 270a32104..2cf0b1ccf 100644 --- a/packages/zanui-css/src/switch.css +++ b/packages/zanui-css/src/switch.css @@ -1,4 +1,4 @@ -@component-namespace z { +@component-namespace zan { @b switch { height: 29px; width: 49px; @@ -26,6 +26,15 @@ } } + @e loading { + width: 16px; + height: 16px; + position: relative; + left: 50%; + top: 50%; + transform: translate3d(-50%, -50%, 0); + } + @when on { background-color: #44db5e; border-color: #44db5e; @@ -37,14 +46,7 @@ } @when disabled { - @when off { - background-color: #f2f2f2; - border-color: rgba(0, 0, 0, .1); - } - @when on { - background-color: #a6e7b1; - border-color: #a6e7b1; - } + opacity: .4; } } }