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); } }
點擊折疊判斷是否有數據,進行加減數組
