使用VueFire编辑Firebase数据 [英] Edit Firebase data using VueFire

查看:466
本文介绍了使用VueFire编辑Firebase数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的 admin 应用程序,可以通过表单创建新的商家,并将它们添加到表中。我创建了添加和删除条目的方法,但不知道如何继续创建更新方法。内容是contenteditable,我想保存在保存按钮单击。请参阅我的CodePen: http://codepen.io/Auzy/pen/177244afc7cb487905b927dd3a32ae61 要做到这个我用VueJS和Vuefire用下面的方式(原谅Bootstrap):

$ $ $ $ $ $ $ $ $ $表格 - >
< table class =table table-striped>
< tr>
企业名称< / th>
Vanity URL< / th>
Story< / th>
< th>动作< / th>
< / tr>
< tr v-for =post in posts:key =post ['.key']>
< td contenteditable v-model =newPost.title> {{post.title}}< / td>
< td> {{post.content}}< / td>
< td> {{post.story}}< / td>
< td>