no message
This commit is contained in:
parent
e7874661f3
commit
438f74fac9
@ -124,7 +124,14 @@ export default {
|
|||||||
|
|
||||||
autoToBottom() {
|
autoToBottom() {
|
||||||
if (this.autoBottom && this.$refs.bottom) {
|
if (this.autoBottom && this.$refs.bottom) {
|
||||||
this.$refs.bottom.scrollIntoView(false);
|
try {
|
||||||
|
this.$refs.bottom.scrollIntoView(false);
|
||||||
|
} catch (e) {
|
||||||
|
scrollIntoView(this.$refs.bottom, {
|
||||||
|
behavior: 'instant',
|
||||||
|
inline: 'end',
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
v-for="(dialog, key) in dialogLists"
|
v-for="(dialog, key) in dialogLists"
|
||||||
:key="key"
|
:key="key"
|
||||||
:class="{active: dialog.id == dialogId}"
|
:class="{active: dialog.id == dialogId}"
|
||||||
@click="openDialog(dialog)">
|
@click="openDialog(dialog, true)">
|
||||||
<Icon v-if="dialog.type=='group'" class="icon-avatar" type="ios-people" />
|
<Icon v-if="dialog.type=='group'" class="icon-avatar" type="ios-people" />
|
||||||
<div v-else-if="dialog.dialog_user" class="user-avatar"><UserAvatar :userid="dialog.dialog_user.userid" :size="46" hide-icon-menu/></div>
|
<div v-else-if="dialog.dialog_user" class="user-avatar"><UserAvatar :userid="dialog.dialog_user.userid" :size="46" hide-icon-menu/></div>
|
||||||
<Icon v-else class="icon-avatar" type="md-person" />
|
<Icon v-else class="icon-avatar" type="md-person" />
|
||||||
@ -122,17 +122,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
openDialog(dialog) {
|
openDialog(dialog, smooth) {
|
||||||
this.$store.state.method.setStorage("messengerDialogId", dialog.id)
|
this.$store.state.method.setStorage("messengerDialogId", dialog.id)
|
||||||
this.$store.dispatch("getDialogMsgList", dialog.id);
|
this.$store.dispatch("getDialogMsgList", dialog.id);
|
||||||
this.scrollIntoActive();
|
this.scrollIntoActive(smooth);
|
||||||
},
|
},
|
||||||
|
|
||||||
openDialogStorage() {
|
openDialogStorage() {
|
||||||
let tmpId = this.$store.state.method.getStorageInt("messengerDialogId")
|
let tmpId = this.$store.state.method.getStorageInt("messengerDialogId")
|
||||||
if (tmpId > 0) {
|
if (tmpId > 0) {
|
||||||
const dialog = this.dialogList.find(({id}) => id === tmpId);
|
const dialog = this.dialogList.find(({id}) => id === tmpId);
|
||||||
dialog && this.openDialog(dialog);
|
dialog && this.openDialog(dialog, false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -214,13 +214,13 @@ export default {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
scrollIntoActive() {
|
scrollIntoActive(smooth) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$refs.list) {
|
if (this.$refs.list) {
|
||||||
let active = this.$refs.list.querySelector(".active")
|
let active = this.$refs.list.querySelector(".active")
|
||||||
if (active) {
|
if (active) {
|
||||||
scrollIntoView(active, {
|
scrollIntoView(active, {
|
||||||
behavior: 'instant',
|
behavior: smooth === true ? 'smooth' : 'instant',
|
||||||
scrollMode: 'if-needed',
|
scrollMode: 'if-needed',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user