uView 折叠面板显示,绑定默认显示

u-collapse-item open属性默认为单个数据,直接使用:open=“index”,会使面板变成手风琴效果

即使accordion为false 也是一样,需要保存折叠面板索引为数组,再判断:open="current.indexOf(i) > -1",是否在数组中

changeBox(obj,index){
    changeBox(obj,index){
    // 查询到的数组下标
    let subscript = this.current.indexOf(index);
    if( subscript < 0){
    this.current.push(index);
    }else{
    this.current.splice(subscript,1);
    }

}

  点击折叠判断是否有数据,进行加减数组

原文地址:https://www.cnblogs.com/fhysy/p/15696484.html