docs: reduce demo mentions/slider/switch (#25486)

This commit is contained in:
xrkffgg 2020-07-07 23:04:27 +08:00 committed by GitHub
parent 22d4dbbe99
commit 8079e0fb8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 84 additions and 84 deletions

View File

@ -177,7 +177,7 @@ exports[`renders ./components/mentions/demo/prefix.md correctly 1`] = `
`;
exports[`renders ./components/mentions/demo/readonly.md correctly 1`] = `
<div>
Array [
<div
style="margin-bottom:10px"
>
@ -192,7 +192,7 @@ exports[`renders ./components/mentions/demo/readonly.md correctly 1`] = `
rows="1"
/>
</div>
</div>
</div>,
<div
class="ant-mentions"
style="width:100%"
@ -203,6 +203,6 @@ exports[`renders ./components/mentions/demo/readonly.md correctly 1`] = `
readonly=""
rows="1"
/>
</div>
</div>
</div>,
]
`;

View File

@ -28,7 +28,7 @@ function getOptions() {
function App() {
return (
<div>
<>
<div style={{ marginBottom: 10 }}>
<Mentions style={{ width: '100%' }} placeholder="this is disabled Mentions" disabled>
{getOptions()}
@ -37,7 +37,7 @@ function App() {
<Mentions style={{ width: '100%' }} placeholder="this is readOnly Mentions" readOnly>
{getOptions()}
</Mentions>
</div>
</>
);
}

View File

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./components/slider/demo/basic.md correctly 1`] = `
<div>
Array [
<div
class="ant-slider"
>
@ -28,7 +28,7 @@ exports[`renders ./components/slider/demo/basic.md correctly 1`] = `
<div
class="ant-slider-mark"
/>
</div>
</div>,
<div
class="ant-slider"
>
@ -65,8 +65,8 @@ exports[`renders ./components/slider/demo/basic.md correctly 1`] = `
<div
class="ant-slider-mark"
/>
</div>
Disabled:
</div>,
"Disabled: ",
<button
aria-checked="false"
class="ant-switch ant-switch-small"
@ -79,12 +79,12 @@ exports[`renders ./components/slider/demo/basic.md correctly 1`] = `
<span
class="ant-switch-inner"
/>
</button>
</div>
</button>,
]
`;
exports[`renders ./components/slider/demo/event.md correctly 1`] = `
<div>
Array [
<div
class="ant-slider"
>
@ -111,7 +111,7 @@ exports[`renders ./components/slider/demo/event.md correctly 1`] = `
<div
class="ant-slider-mark"
/>
</div>
</div>,
<div
class="ant-slider"
>
@ -148,8 +148,8 @@ exports[`renders ./components/slider/demo/event.md correctly 1`] = `
<div
class="ant-slider-mark"
/>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/slider/demo/icon-slider.md correctly 1`] = `
@ -470,10 +470,10 @@ exports[`renders ./components/slider/demo/input-number.md correctly 1`] = `
`;
exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
<div>
Array [
<h4>
included=true
</h4>
</h4>,
<div
class="ant-slider ant-slider-with-marks"
>
@ -544,7 +544,7 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
</strong>
</span>
</div>
</div>
</div>,
<div
class="ant-slider ant-slider-with-marks"
>
@ -625,10 +625,10 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
</strong>
</span>
</div>
</div>
</div>,
<h4>
included=false
</h4>
</h4>,
<div
class="ant-slider ant-slider-with-marks"
>
@ -695,10 +695,10 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
</strong>
</span>
</div>
</div>
</div>,
<h4>
marks & step
</h4>
</h4>,
<div
class="ant-slider ant-slider-with-marks"
>
@ -769,10 +769,10 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
</strong>
</span>
</div>
</div>
</div>,
<h4>
step=null
</h4>
</h4>,
<div
class="ant-slider ant-slider-with-marks"
>
@ -843,12 +843,12 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
</strong>
</span>
</div>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/slider/demo/reverse.md correctly 1`] = `
<div>
Array [
<div
class="ant-slider"
>
@ -875,7 +875,7 @@ exports[`renders ./components/slider/demo/reverse.md correctly 1`] = `
<div
class="ant-slider-mark"
/>
</div>
</div>,
<div
class="ant-slider"
>
@ -912,8 +912,8 @@ exports[`renders ./components/slider/demo/reverse.md correctly 1`] = `
<div
class="ant-slider-mark"
/>
</div>
Reversed:
</div>,
"Reversed: ",
<button
aria-checked="true"
class="ant-switch ant-switch-small ant-switch-checked"
@ -926,8 +926,8 @@ exports[`renders ./components/slider/demo/reverse.md correctly 1`] = `
<span
class="ant-switch-inner"
/>
</button>
</div>
</button>,
]
`;
exports[`renders ./components/slider/demo/show-tooltip.md correctly 1`] = `
@ -985,7 +985,7 @@ exports[`renders ./components/slider/demo/show-tooltip.md correctly 1`] = `
`;
exports[`renders ./components/slider/demo/tip-formatter.md correctly 1`] = `
<div>
Array [
<div
class="ant-slider"
>
@ -1012,7 +1012,7 @@ exports[`renders ./components/slider/demo/tip-formatter.md correctly 1`] = `
<div
class="ant-slider-mark"
/>
</div>
</div>,
<div
class="ant-slider"
>
@ -1039,12 +1039,12 @@ exports[`renders ./components/slider/demo/tip-formatter.md correctly 1`] = `
<div
class="ant-slider-mark"
/>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
<div>
Array [
<div
style="display:inline-block;height:300px;margin-left:70px"
>
@ -1075,7 +1075,7 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
class="ant-slider-mark"
/>
</div>
</div>
</div>,
<div
style="display:inline-block;height:300px;margin-left:70px"
>
@ -1116,7 +1116,7 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
class="ant-slider-mark"
/>
</div>
</div>
</div>,
<div
style="display:inline-block;height:300px;margin-left:70px"
>
@ -1201,6 +1201,6 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
</span>
</div>
</div>
</div>
</div>
</div>,
]
`;

View File

@ -28,11 +28,11 @@ class Demo extends React.Component {
render() {
const { disabled } = this.state;
return (
<div>
<>
<Slider defaultValue={30} disabled={disabled} />
<Slider range defaultValue={[20, 50]} disabled={disabled} />
Disabled: <Switch size="small" checked={disabled} onChange={this.handleDisabledChange} />
</div>
</>
);
}
}

View File

@ -25,7 +25,7 @@ function onAfterChange(value) {
}
ReactDOM.render(
<div>
<>
<Slider defaultValue={30} onChange={onChange} onAfterChange={onAfterChange} />
<Slider
range
@ -34,7 +34,7 @@ ReactDOM.render(
onChange={onChange}
onAfterChange={onAfterChange}
/>
</div>,
</>,
mountNode,
);
```

View File

@ -29,7 +29,7 @@ const marks = {
};
ReactDOM.render(
<div>
<>
<h4>included=true</h4>
<Slider marks={marks} defaultValue={37} />
<Slider range marks={marks} defaultValue={[26, 37]} />
@ -42,7 +42,7 @@ ReactDOM.render(
<h4>step=null</h4>
<Slider marks={marks} step={null} defaultValue={37} />
</div>,
</>,
mountNode,
);
```

View File

@ -28,11 +28,11 @@ class Demo extends React.Component {
render() {
const { reverse } = this.state;
return (
<div>
<>
<Slider defaultValue={30} reverse={reverse} />
<Slider range defaultValue={[20, 50]} reverse={reverse} />
Reversed: <Switch size="small" checked={reverse} onChange={this.handleReverseChange} />
</div>
</>
);
}
}

View File

@ -21,10 +21,10 @@ function formatter(value) {
}
ReactDOM.render(
<div>
<>
<Slider tipFormatter={formatter} />
<Slider tipFormatter={null} />
</div>,
</>,
mountNode,
);
```

View File

@ -35,7 +35,7 @@ const marks = {
};
ReactDOM.render(
<div>
<>
<div style={style}>
<Slider vertical defaultValue={30} />
</div>
@ -45,7 +45,7 @@ ReactDOM.render(
<div style={style}>
<Slider vertical range marks={marks} defaultValue={[26, 37]} />
</div>
</div>,
</>,
mountNode,
);
```

View File

@ -17,7 +17,7 @@ exports[`renders ./components/switch/demo/basic.md correctly 1`] = `
`;
exports[`renders ./components/switch/demo/disabled.md correctly 1`] = `
<div>
Array [
<button
aria-checked="true"
class="ant-switch ant-switch-checked ant-switch-disabled"
@ -31,8 +31,8 @@ exports[`renders ./components/switch/demo/disabled.md correctly 1`] = `
<span
class="ant-switch-inner"
/>
</button>
<br />
</button>,
<br />,
<button
class="ant-btn ant-btn-primary"
type="button"
@ -40,12 +40,12 @@ exports[`renders ./components/switch/demo/disabled.md correctly 1`] = `
<span>
Toggle disabled
</span>
</button>
</div>
</button>,
]
`;
exports[`renders ./components/switch/demo/loading.md correctly 1`] = `
<div>
Array [
<button
aria-checked="true"
class="ant-switch ant-switch-loading ant-switch-checked ant-switch-disabled"
@ -80,8 +80,8 @@ exports[`renders ./components/switch/demo/loading.md correctly 1`] = `
<span
class="ant-switch-inner"
/>
</button>
<br />
</button>,
<br />,
<button
aria-checked="false"
class="ant-switch ant-switch-small ant-switch-loading ant-switch-disabled"
@ -116,12 +116,12 @@ exports[`renders ./components/switch/demo/loading.md correctly 1`] = `
<span
class="ant-switch-inner"
/>
</button>
</div>
</button>,
]
`;
exports[`renders ./components/switch/demo/size.md correctly 1`] = `
<div>
Array [
<button
aria-checked="true"
class="ant-switch ant-switch-checked"
@ -134,8 +134,8 @@ exports[`renders ./components/switch/demo/size.md correctly 1`] = `
<span
class="ant-switch-inner"
/>
</button>
<br />
</button>,
<br />,
<button
aria-checked="true"
class="ant-switch ant-switch-small ant-switch-checked"
@ -148,12 +148,12 @@ exports[`renders ./components/switch/demo/size.md correctly 1`] = `
<span
class="ant-switch-inner"
/>
</button>
</div>
</button>,
]
`;
exports[`renders ./components/switch/demo/text.md correctly 1`] = `
<div>
Array [
<button
aria-checked="true"
class="ant-switch ant-switch-checked"
@ -168,8 +168,8 @@ exports[`renders ./components/switch/demo/text.md correctly 1`] = `
>
开启
</span>
</button>
<br />
</button>,
<br />,
<button
aria-checked="false"
class="ant-switch"
@ -184,8 +184,8 @@ exports[`renders ./components/switch/demo/text.md correctly 1`] = `
>
0
</span>
</button>
<br />
</button>,
<br />,
<button
aria-checked="true"
class="ant-switch ant-switch-checked"
@ -219,6 +219,6 @@ exports[`renders ./components/switch/demo/text.md correctly 1`] = `
</svg>
</span>
</span>
</button>
</div>
</button>,
]
`;

View File

@ -29,13 +29,13 @@ class App extends React.Component {
render() {
return (
<div>
<>
<Switch disabled={this.state.disabled} defaultChecked />
<br />
<Button type="primary" onClick={this.toggle}>
Toggle disabled
</Button>
</div>
</>
);
}
}

View File

@ -17,11 +17,11 @@ Mark a pending state of switch.
import { Switch } from 'antd';
ReactDOM.render(
<div>
<>
<Switch loading defaultChecked />
<br />
<Switch size="small" loading />
</div>,
</>,
mountNode,
);
```

View File

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

View File

@ -18,7 +18,7 @@ import { Switch } from 'antd';
import { CloseOutlined, CheckOutlined } from '@ant-design/icons';
ReactDOM.render(
<div>
<>
<Switch checkedChildren="开启" unCheckedChildren="关闭" defaultChecked />
<br />
<Switch checkedChildren="1" unCheckedChildren="0" />
@ -28,7 +28,7 @@ ReactDOM.render(
unCheckedChildren={<CloseOutlined />}
defaultChecked
/>
</div>,
</>,
mountNode,
);
```