浏览代码

Merge branch 'master' of http://git.jihengcc.cn/liubaiyan/qjd-shell-uniapp

zhaoxw 4 年之前
父节点
当前提交
ae8d660b39
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      jhlive/jhlive.nvue

+ 7 - 1
jhlive/jhlive.nvue

@@ -17,7 +17,7 @@
 		<view class="bottom-message">
 			<!-- 对话信息 --> 
 			<!-- <view class="jhim-message-box"> -->
-			<scroll-view scroll-y="true" v-if="showIm" class="jhim-message-box">
+			<scroll-view :scroll-top="imScrollTop" scroll-y="true" v-if="showIm" class="jhim-message-box">
 			  <view class="jhim-message" v-for="(item, index) in imMsgs.slice(-10)" :key="index">
 				<view class="jhim-message-show" >
 					<!-- <text class="jhim-message-text2">{{item.name}}:</text> -->
@@ -82,6 +82,7 @@
 		//#endif
 		data() {
 			return {
+				imScrollTop: 0,
 				imgs,
 				imInput: '',
 				userSig: '',
@@ -126,6 +127,11 @@
 		unmounted() {
 			this.destroy();
 		},
+		watch: {
+			imMsgs() {
+				this.imScrollTop = 10000+this.imMsgs.length;
+			}
+		},
 		methods: {
 			init() {
 				console.log(LOGTAG + 'init');