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