You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,20 +154,20 @@ The resulting bound array stored in `vm.items` will be:
154
154
}
155
155
]
156
156
```
157
-
Therefore to delete or update an item: first you have to obtain a reference to the '.key' property or the item object. In your Vue instance you could add
158
-
```js
159
-
//pass '.key' property from html
160
-
vm.deleteItem=function(key) {
161
-
var ref =db.ref('items/'+key)
162
-
ref.remove()
163
-
}
164
-
//pass in item object from html
165
-
vm.updateItem=function(item) {
166
-
var key = item['.key']
167
-
var ref =db.ref('items/'+key)
168
-
ref.set(item)
157
+
158
+
To delete or update an item you can use the `.key` property of a given object:
0 commit comments