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: { attendees: {
deep: true, deep: true,
handler() { handler() {
if (this.$refs && this.$refs.history) {
setTimeout(() => { setTimeout(() => {
this.$refs.attendees.scrollTop = this.$refs.attendees.scrollHeight; this.$refs.attendees.scrollTop = this.$refs.attendees.scrollHeight;
}, 50); }, 50);
} }
} }
} }
}
}; };
</script> </script>

View File

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