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 { 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; }, }, render() { const accordion = this.accordion; const btn = accordion ? 'Mode: accordion' : 'Mode: collapse'; const activeKey = this.activeKey; return (




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