Reputation: 19
I have a problem
I want to get a value for each row value of posts in textarea
as in this image I want to have a value for each line written When I press the enter key and go to the bottom line and write there, I want to get the text written on that second line as a second value.
my goal is to be able to draw for each column
vuejs compisitions api or option api
Upvotes: 0
Views: 142
Reputation: 141
Try this.
<script>
import { ref, computed } from 'vue'
export default {
setup() {
const textAreaText = ref('')
const values = computed(() => textAreaText.value.split('\n'))
return { textAreaText, values }
}
}
</script>
<template>
<textarea v-model="textAreaText"></textarea>
<p>
{{ values }}
</p>
</template>
Upvotes: 1