let that = this
this.$nextTick(()=>{
that.dataList.forEach((item,index)=>{
let id = 'qk'+index
let dom = document.querySelector('#'+id)
if(dom.offsetHeight>50){
debugger
item.zhankai = false
dom.style.overflow = 'hidden'
dom.style.textOverflow = 'ellipsis'
dom.style.display = '-webkit-box'
}
})
this.$forceUpdate()
})
判断是否超过2行加了点点,溢出则展示展开,反之展示收起
最新推荐文章于 2024-01-31 00:32:18 发布