mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
update switch demo
This commit is contained in:
parent
dd3f7f2da1
commit
61ab3a4a9e
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
exports[`renders ./components/switch/demo/basic.md correctly 1`] = `
|
exports[`renders ./components/switch/demo/basic.md correctly 1`] = `
|
||||||
<span
|
<span
|
||||||
class="ant-switch"
|
class="ant-switch ant-switch-checked"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@ -58,7 +58,7 @@ exports[`renders ./components/switch/demo/loading.md correctly 1`] = `
|
|||||||
exports[`renders ./components/switch/demo/size.md correctly 1`] = `
|
exports[`renders ./components/switch/demo/size.md correctly 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<span
|
<span
|
||||||
class="ant-switch"
|
class="ant-switch ant-switch-checked"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@ -67,7 +67,7 @@ exports[`renders ./components/switch/demo/size.md correctly 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
<br />
|
<br />
|
||||||
<span
|
<span
|
||||||
class="ant-switch-small ant-switch"
|
class="ant-switch-small ant-switch ant-switch-checked"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@ -80,13 +80,13 @@ exports[`renders ./components/switch/demo/size.md correctly 1`] = `
|
|||||||
exports[`renders ./components/switch/demo/text.md correctly 1`] = `
|
exports[`renders ./components/switch/demo/text.md correctly 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<span
|
<span
|
||||||
class="ant-switch"
|
class="ant-switch ant-switch-checked"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-switch-inner"
|
class="ant-switch-inner"
|
||||||
>
|
>
|
||||||
关
|
开
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<br />
|
<br />
|
||||||
@ -102,14 +102,14 @@ exports[`renders ./components/switch/demo/text.md correctly 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
<br />
|
<br />
|
||||||
<span
|
<span
|
||||||
class="ant-switch"
|
class="ant-switch ant-switch-checked"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="ant-switch-inner"
|
class="ant-switch-inner"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
class="anticon anticon-cross"
|
class="anticon anticon-check"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -21,7 +21,7 @@ function onChange(checked) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Switch defaultChecked={false} onChange={onChange} />,
|
<Switch defaultChecked onChange={onChange} />,
|
||||||
mountNode
|
mountNode
|
||||||
);
|
);
|
||||||
````
|
````
|
||||||
|
@ -18,9 +18,9 @@ import { Switch } from 'antd';
|
|||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<div>
|
<div>
|
||||||
<Switch />
|
<Switch defaultChecked />
|
||||||
<br />
|
<br />
|
||||||
<Switch size="small" />
|
<Switch size="small" defaultChecked />
|
||||||
</div>
|
</div>
|
||||||
, mountNode);
|
, mountNode);
|
||||||
````
|
````
|
||||||
|
@ -18,11 +18,11 @@ import { Switch, Icon } from 'antd';
|
|||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<div>
|
<div>
|
||||||
<Switch checkedChildren="开" unCheckedChildren="关" />
|
<Switch checkedChildren="开" unCheckedChildren="关" defaultChecked />
|
||||||
<br />
|
<br />
|
||||||
<Switch checkedChildren="1" unCheckedChildren="0" />
|
<Switch checkedChildren="1" unCheckedChildren="0" />
|
||||||
<br />
|
<br />
|
||||||
<Switch checkedChildren={<Icon type="check" />} unCheckedChildren={<Icon type="cross" />} />
|
<Switch checkedChildren={<Icon type="check" />} unCheckedChildren={<Icon type="cross" />} defaultChecked />
|
||||||
</div>
|
</div>
|
||||||
, mountNode);
|
, mountNode);
|
||||||
````
|
````
|
||||||
|
Loading…
Reference in New Issue
Block a user