updat demo

This commit is contained in:
zombiej 2019-03-07 11:50:13 +08:00
parent 7e48360c85
commit 82c4b52496
2 changed files with 15 additions and 3 deletions

View File

@ -477,6 +477,7 @@ exports[`renders ./components/collapse/demo/extra.md correctly 1`] = `
<i
aria-label="icon: setting"
class="anticon anticon-setting"
tabindex="-1"
>
<svg
aria-hidden="true"
@ -544,6 +545,7 @@ exports[`renders ./components/collapse/demo/extra.md correctly 1`] = `
<i
aria-label="icon: setting"
class="anticon anticon-setting"
tabindex="-1"
>
<svg
aria-hidden="true"
@ -596,6 +598,7 @@ exports[`renders ./components/collapse/demo/extra.md correctly 1`] = `
<i
aria-label="icon: setting"
class="anticon anticon-setting"
tabindex="-1"
>
<svg
aria-hidden="true"

View File

@ -28,15 +28,24 @@ const text = `
it can be found as a welcome guest in many households across the world.
`;
const genExtra = () => (
<Icon
type="setting"
onClick={(event) => {
event.stopPropagation();
}}
/>
);
ReactDOM.render(
<Collapse defaultActiveKey={['1']} onChange={callback}>
<Panel header="This is panel header 1" key="1" extra={<Icon type="setting" />}>
<Panel header="This is panel header 1" key="1" extra={genExtra()}>
<div>{text}</div>
</Panel>
<Panel header="This is panel header 2" key="2" extra={<Icon type="setting" />}>
<Panel header="This is panel header 2" key="2" extra={genExtra()}>
<div>{text}</div>
</Panel>
<Panel header="This is panel header 3" key="3" extra={<Icon type="setting" />}>
<Panel header="This is panel header 3" key="3" extra={genExtra()}>
<div>{text}</div>
</Panel>
</Collapse>,