Firestore不会保存文本区域中的换行符 [英] Firestore does not save line breaks from text area
本文介绍了Firestore不会保存文本区域中的换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用带有Vue v-model的文本区域并将其保存在Firestore集合中.但是换行符在数据库中消失了.
I am using a text area with Vue v-model and saving it in a firestore collection. But the line breaks disappear in database.
如何解决?
<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显示空白(换行符)
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)
这篇关于Firestore不会保存文本区域中的换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文