diff --git a/src/switch/README.md b/src/switch/README.md index 0a3f3d07e..ce10e35a4 100644 --- a/src/switch/README.md +++ b/src/switch/README.md @@ -78,6 +78,14 @@ export default { }; ``` +### Inside a Cell + +```html + + + +``` + ## API ### Props diff --git a/src/switch/README.zh-CN.md b/src/switch/README.zh-CN.md index c867124f5..63364a41e 100644 --- a/src/switch/README.zh-CN.md +++ b/src/switch/README.zh-CN.md @@ -90,6 +90,14 @@ export default { }; ``` +### 搭配单元格使用 + +```html + + + +``` + ## API ### Props diff --git a/src/switch/demo/index.vue b/src/switch/demo/index.vue index 11038934b..6487e531a 100644 --- a/src/switch/demo/index.vue +++ b/src/switch/demo/index.vue @@ -17,12 +17,22 @@ - + + + + + + + @@ -30,15 +40,19 @@ export default { i18n: { 'zh-CN': { - title: '提醒', + title: '标题', + confirm: '提醒', message: '是否切换开关?', + withCell: '搭配单元格使用', customSize: '自定义大小', customColor: '自定义颜色', asyncControl: '异步控制' }, 'en-US': { - title: 'Confirm', + title: 'Title', + confirm: 'Confirm', message: 'Are you sure to toggle switch?', + withCell: 'Inside a Cell', customSize: 'Custom Size', customColor: 'Custom Color', asyncControl: 'Async Control' @@ -50,7 +64,9 @@ export default { checked: true, checked2: true, checked3: true, - checked4: true + checked4: true, + checked5: true, + checked6: false }; }, @@ -73,10 +89,8 @@ export default { @import '../../style/var'; .demo-switch { - background: @white; - .van-switch { - margin: 0 @padding-md; + margin-left: @padding-md; } } diff --git a/src/switch/test/__snapshots__/demo.spec.js.snap b/src/switch/test/__snapshots__/demo.spec.js.snap index d8fbbb2e4..a47434536 100644 --- a/src/switch/test/__snapshots__/demo.spec.js.snap +++ b/src/switch/test/__snapshots__/demo.spec.js.snap @@ -34,5 +34,13 @@ exports[`renders demo correctly 1`] = `
+
+
+
标题
+
+
+
+
+
`;