[Vuejs]-Accessing vue $ref returns undefined

0👍

Enclose your codeblock within this.$nextTick to make it work

this.$nextTick(() => {
  const tableRef = this.$refs['table-ref'];
  tableRef.scrollLeft = tableRef.offsetWidth;
});

Leave a comment