gpt4 book ai didi

firebase - Firestore 不保存文本区域的换行符

转载 作者:搜寻专家 更新时间:2023-10-30 22:12:53 27 4
gpt4 key购买 nike

我正在使用带有 Vue v-model 的文本区域并将其保存在 firestore 集合中。但是换行符在数据库中消失了。

如何修复?

<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
})

最佳答案

换行符不会出现在 Firestore 控制台中,文本显示为单行,但它们已保存。只需在下面的链接中应用标记的答案。 Vue.js show white space (line breaks)

关于firebase - Firestore 不保存文本区域的换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48106793/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com