如题,需要加什么属性?
注:在不知道有多少条数据的情况下
贴个代码:
<el-collapse v-model="activeNames">
<el-collapse-item v-for="(item,index) in typesContractData" :key="item.id" :title="item.name" :name="index">
···
</el-collapse-item>
</el-collapse>
activeNames:[]
...
for(var i = 0; i < this.typesContractData.length; i++) {
this.activeNames.push(i.toString())
}
<el-collapse v-model="activeNames" @change="handleChange">