update switch demo

pull/8479/head
afc163 7 years ago
parent dd3f7f2da1
commit 61ab3a4a9e

@ -2,7 +2,7 @@
exports[`renders ./components/switch/demo/basic.md correctly 1`] = `
<span
class="ant-switch"
class="ant-switch ant-switch-checked"
tabindex="0"
>
<span
@ -58,7 +58,7 @@ exports[`renders ./components/switch/demo/loading.md correctly 1`] = `
exports[`renders ./components/switch/demo/size.md correctly 1`] = `
<div>
<span
class="ant-switch"
class="ant-switch ant-switch-checked"
tabindex="0"
>
<span
@ -67,7 +67,7 @@ exports[`renders ./components/switch/demo/size.md correctly 1`] = `
</span>
<br />
<span
class="ant-switch-small ant-switch"
class="ant-switch-small ant-switch ant-switch-checked"
tabindex="0"
>
<span
@ -80,13 +80,13 @@ exports[`renders ./components/switch/demo/size.md correctly 1`] = `
exports[`renders ./components/switch/demo/text.md correctly 1`] = `
<div>
<span
class="ant-switch"
class="ant-switch ant-switch-checked"
tabindex="0"
>
<span
class="ant-switch-inner"
>
</span>
</span>
<br />
@ -102,14 +102,14 @@ exports[`renders ./components/switch/demo/text.md correctly 1`] = `
</span>
<br />
<span
class="ant-switch"
class="ant-switch ant-switch-checked"
tabindex="0"
>
<span
class="ant-switch-inner"
>
<i
class="anticon anticon-cross"
class="anticon anticon-check"
/>
</span>
</span>

@ -21,7 +21,7 @@ function onChange(checked) {
}
ReactDOM.render(
<Switch defaultChecked={false} onChange={onChange} />,
<Switch defaultChecked onChange={onChange} />,
mountNode
);
````

@ -18,9 +18,9 @@ import { Switch } from 'antd';
ReactDOM.render(
<div>
<Switch />
<Switch defaultChecked />
<br />
<Switch size="small" />
<Switch size="small" defaultChecked />
</div>
, mountNode);
````

@ -18,11 +18,11 @@ import { Switch, Icon } from 'antd';
ReactDOM.render(
<div>
<Switch checkedChildren="开" unCheckedChildren="关" />
<Switch checkedChildren="开" unCheckedChildren="关" defaultChecked />
<br />
<Switch checkedChildren="1" unCheckedChildren="0" />
<br />
<Switch checkedChildren={<Icon type="check" />} unCheckedChildren={<Icon type="cross" />} />
<Switch checkedChildren={<Icon type="check" />} unCheckedChildren={<Icon type="cross" />} defaultChecked />
</div>
, mountNode);
````

Loading…
Cancel
Save