I am using a text area with Vue v-model and saving it in a firestore collection. But the line breaks disappear in database.
How can it be fixed ?
<div class="form-group">
<textarea v-model="docsInfo" rows="3"></textarea>
</div>
// ... JS
export default {
data() {
return {
title: "",
docsInfo: "",
};
},
// ...
db
.collection("posts")
.add({
title: this.title,
info: this.docsInfo // from text area
})
The line breaks don't appear in Firestore console and the text is shown as a single line, but they are saved. Just apply the marked answer in the link below. Vue.js show white space (line breaks)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With