- 首页 > it技术 > >
element-ui 折叠面板一次只展开一行
// 折叠面板每次只能展开一行
expandSelect(row, expandedRows) {
var that = this
this.percentage=0;
this.isShVideo=false;
this.isVideo=false;
this.openscheme=row.scheme_id;
// console.log(row);
setTimeout(()=>{
video=document.querySelector('.tableBox video:first-child');
//获取第一个视频得播放状态
videos=document.querySelectorAll('.tableBox video');
},10);
//延迟获取,避免dom树没有建好
if (expandedRows.length) {
that.expands = []
if (row) {
that.expands.push(row.scheme_id)
// console.log(that.expands);
}
} else {
that.expands = []
};
if(this.expands.length>=1){
// 这里设置定时器的原因是 在展开行瞬间打开的时候 dom树可能还没有准备就绪防止出现null的情况
setTimeout(()=>{
if(row.material_screen_type=="cross"){
this.isShVideo=true;
}else{
this.isVideo=true;
}
video.addEventListener("canplay",function(){
setTimeout(() => {
that.playVideo(videos)
}, 1000);
that.play=false;
that.stop=true;
});
video.addEventListener("ended",function(){
that.stopVideo(videos);
that.play=true;
that.stop=false;
})
},10)
};
pub._InitAxios({
_url: pub._url,
ur: pub._DetailApi.ProGetMater,
data: {
"pageSize":this.page.pageSize,
"pageNum":this.page.currPage,
},
cbk:(res)=>{
// console.log(res.data.list)
for(var c=0;
c
推荐阅读