From 3c253f4762ad65990ee19523c625f908eaf17899 Mon Sep 17 00:00:00 2001 From: Cristiano Magro <cristiano.magro@vola.it> Date: Sun, 29 Dec 2024 17:11:59 +0100 Subject: [PATCH] descrizione specifiche emit --- 07 - development setup/vue-cli-01-a-new-vue-project/src/components/FriendContact.vue | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/07 - development setup/vue-cli-01-a-new-vue-project/src/components/FriendContact.vue b/07 - development setup/vue-cli-01-a-new-vue-project/src/components/FriendContact.vue index d335955..630e9f7 100644 --- a/07 - development setup/vue-cli-01-a-new-vue-project/src/components/FriendContact.vue +++ b/07 - development setup/vue-cli-01-a-new-vue-project/src/components/FriendContact.vue @@ -24,7 +24,7 @@ // 'isFavorite' // ], props: { - id:{ + id: { title: String, required: true }, @@ -49,7 +49,16 @@ // } }, }, - + emits:['toggle-favorite'], + // emits: { + // 'toggle-favorite': function (id) { + // if (id) { + // return true; + // } else { + // return false; + // } + // } + // }, data() { return { detailsAreVisible: false, @@ -60,7 +69,6 @@ this.detailsAreVisible = !this.detailsAreVisible; }, toggleFavorite() { - // this.friendIsFavorite = !this.friendIsFavorite; this.$emit('toggle-favorite', this.id); }, }, -- Gitblit v1.8.0