07 - development setup/vue-cli-01-a-new-vue-project/src/components/FriendContact.vue
@@ -12,6 +12,7 @@ <li><strong>Phone:</strong> {{ phoneNumber }}</li> <li><strong>Email:</strong> {{ emailAddress }}</li> </ul> <button @click="$emit('delete', id)">Delete</button> </li> </template> @@ -49,7 +50,7 @@ // } }, }, emits:['toggle-favorite'], emits:['toggle-favorite', 'delete'], // emits: { // 'toggle-favorite': function (id) { // if (id) { @@ -71,6 +72,9 @@ toggleFavorite() { this.$emit('toggle-favorite', this.id); }, // deleteFriend(){ // this.$emit('delete', this.id); // } }, }; </script>