ant-design/components/collapse/demo/noarrow.md

43 lines
886 B
Markdown
Raw Normal View History

---
order: 4
title:
zh-CN: 隐藏箭头
en-US: No arrow
---
## zh-CN
你可以通过 `showArrow={false}` 隐藏 `CollapsePanel` 组件的箭头图标。
## en-US
2019-04-20 06:34:56 +08:00
You can hide the arrow icon by passing `showArrow={false}` to `CollapsePanel` component.
2019-05-07 14:57:32 +08:00
```jsx
import { Collapse } from 'antd';
2018-06-27 15:55:04 +08:00
const Panel = Collapse.Panel;
function callback(key) {
console.log(key);
}
const text = `
A dog is a type of domesticated animal.
Known for its loyalty and faithfulness,
it can be found as a welcome guest in many households across the world.
`;
ReactDOM.render(
<Collapse defaultActiveKey={['1']} onChange={callback}>
<Panel header="This is panel header with arrow icon" key="1">
<p>{text}</p>
</Panel>
<Panel showArrow={false} header="This is panel header with no arrow icon" key="2">
<p>{text}</p>
</Panel>
2018-06-27 15:55:04 +08:00
</Collapse>,
2019-05-07 14:57:32 +08:00
mountNode,
2018-11-28 15:00:03 +08:00
);
2019-05-07 14:57:32 +08:00
```