[Vuejs]-Pass Firebase Props onclick to methods in Vue

0👍

The method declaration for onDelete is invalid because the argument identifier cannot be props.item.id (i.e., the dots are not allowed for the name). The valid characters for an identifier are Unicode letters, $, _, or digits (0-9).

Given the purpose of the argument, I’d rename it to itemId:

methods: {
  onDelete(itemId) {
    // ...
  }
}

Leave a comment