+
@@ -21,6 +21,12 @@ export default{
shownum: Number,
items: Array,
one_height: Number,
+ status:{
+ type: Boolean,
+ default: false
+ }
+ },
+ mounted(){
},
computed:{
containerHeight(){
@@ -34,16 +40,36 @@ export default{
return this.one_height * (this.items.length-this.start-this.shownum+1) + 'px'
},
listTop(){
- console.log(this.items,this.shownum,this.one_height)
+ // console.log(this.items,this.shownum,this.one_height)
return this.one_height * this.start + 'px'
- }
+ },
},
methods:{
scroll_event(e){
const top = e.target.scrollTop
this.start = Math.floor(top / this.one_height)
this.end = this.start + this.shownum
-
+ },
+ chatWithHandle(){
+ console.log(1)
+ if(this.status == true){
+ this.end = this.items.length
+ // console.log(this.end)
+ this.start = this.end - this.shownum
+ if(this.start < 0 ){
+ this.start = 0
+ }else{
+ let scrollElem = this.$refs.scrollDiv
+ scrollElem.scrollTo({top: scrollElem
+ ,behavior: 'smooth'})
+ console.log(1)
+ }
+ }
+ }
+ },
+ watch:{
+ status(){
+ console.log(1)
}
}
}
diff --git a/src/views/chat/HonneyBtn.vue b/src/views/chat/HonneyBtn.vue
index 3dc31fdc..3a2f8343 100644
--- a/src/views/chat/HonneyBtn.vue
+++ b/src/views/chat/HonneyBtn.vue
@@ -2,7 +2,7 @@
-
+
@@ -28,7 +28,7 @@ export default{
status(newvalue){
this.status = newvalue
this.ReviseStatus2Father(this.status)
- console.log(this.newvalue)
+ // console.log(this.newvalue)
},
Status(){
this.status = this.Status
diff --git a/src/views/chat/chat.vue b/src/views/chat/chat.vue
index 80f699d5..ce8e6e13 100644
--- a/src/views/chat/chat.vue
+++ b/src/views/chat/chat.vue
@@ -24,7 +24,7 @@