Only handle if ref exists

This commit is contained in:
2020-03-20 14:29:23 +01:00
parent c53761d8bf
commit 4e76d707b1
2 changed files with 10 additions and 6 deletions

View File

@@ -24,12 +24,14 @@ export default {
attendees: {
deep: true,
handler() {
if (this.$refs && this.$refs.history) {
setTimeout(() => {
this.$refs.attendees.scrollTop = this.$refs.attendees.scrollHeight;
}, 50);
}
}
}
}
};
</script>

View File

@@ -53,9 +53,11 @@ export default {
watch: {
chatHistory: {
handler() {
if (this.$refs && this.$refs.history) {
setTimeout(() => {
this.$refs.history.scrollTop = this.$refs.history.scrollHeight;
}, 10);
}
},
deep: true
}