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);
    }

}

 

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM