[Vuejs]-How can I delete a Firebase document with a condition

0👍

This is the correct Function.
res got the wrong data type!

deleteItem (item, id) {

          const index = this.shoppingLists.indexOf(item)
          let res = confirm('Möchtest Du den Einkaufsschnippsel wirklich Löschen?')
          if (res == true) {
            this.shoppingLists.splice(index, 1)
            firebase.db.collection('shoppingList').doc(id).delete()
          }
        }

Leave a comment