Auto height textarea vue

@Rayhan

1/1. textarea.vue

<template>
<textarea ref="textareaRef" v-model="text" />
</template>

<script>
export default {
data() {
text: "";
},
watch: {
text() {
const textAreaDOM = this.$refs.textareaRef;
textAreaDOM.style.height = "64px"; // <- Give a fixed height
textAreaDOM.style.height = textAreaDOM.scrollHeight + "px";
}
}
};
</script>