当前位置: 代码迷 >> 综合 >> uniapp 聊天界面定位到底部(定位到指定位置)
  详细解决方案

uniapp 聊天界面定位到底部(定位到指定位置)

热度:65   发布时间:2023-12-12 19:33:06.0

相信很多同学一直在为这个头痛!

今天他来了,真的来了...

			this.$nextTick(() => {// document.getElementById("scrolldIV2").scrollIntoView();	 //h5端定位到指定位置	setTimeout(() => {uni.createSelectorQuery().select(".cu-chat").boundingClientRect(function(res) { //定位到你要的class的位置console.log("标签获取====>", res)uni.pageScrollTo({scrollTop: res.height,duration: 0});}).exec()}, 50)//this.viewIndex = "im_" + this.ChatList.length;})