Skip to content

Commit f4559ce

Browse files
authored
Merge pull request #45 from vuejs/readme-update
Add further example about manipulating a ref
2 parents 62bc52d + fd34968 commit f4559ce

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,20 @@ The resulting bound array stored in `vm.items` will be:
155155
]
156156
```
157157

158+
To delete or update an item you can use the `.key` property of a given object:
159+
160+
``` js
161+
// Vue instance methods
162+
deleteItem: function (item) {
163+
this.$firebaseRefs.items.child(item['.key']).remove()
164+
},
165+
updateItem: function (item) {
166+
this.$firebaseRefs.items.child(item['.key']).set(item)
167+
}
168+
```
169+
170+
You can check the full example at [examples/todo-app](examples/todo-app/index.html).
171+
158172
## Contributing
159173

160174
Clone the repo, then:

0 commit comments

Comments
 (0)