9

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
    })
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
le0
  • 791
  • 2
  • 8
  • 19

1 Answers1

9

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)

le0
  • 791
  • 2
  • 8
  • 19