import '../assets/index.less'; import Collapse from '../index'; 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. `; function random() { return parseInt(Math.random() * 10, 10) + 1; } const arrowPath = 'M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88' + '.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.' + '6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-0.7 5.' + '2-2L869 536.2c14.7-12.8 14.7-35.6 0-48.4z'; const { Panel } = Collapse; export default { data() { return { time: random(), accordion: false, activeKey: ['4'], }; }, methods: { onChange(activeKey) { this.activeKey = activeKey; }, getItems() { const items = []; for (let i = 0, len = 3; i < len; i++) { const key = i + 1; items.push(

{text.repeat(this.time)}

, ); } items.push(

{text}

, ); items.push(
, ); items.push( Extra Node}>

Panel with extra

, ); return items; }, setActivityKey() { this.activeKey = ['2']; }, reRender() { this.time = random(); }, toggle() { this.accordion = !this.accordion; }, expandIcon({ isActive }) { return ( ); }, }, render() { const accordion = this.accordion; const btn = accordion ? 'Mode: accordion' : 'Mode: collapse'; const activeKey = this.activeKey; return (




{this.getItems()}
); }, };