Cristiano Magro
2024-12-29 3c253f4762ad65990ee19523c625f908eaf17899
descrizione specifiche emit

per documentare la funzionalità
1 files modified
14 ■■■■ changed files
07 - development setup/vue-cli-01-a-new-vue-project/src/components/FriendContact.vue 14 ●●●● patch | view | raw | blame | history
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);
        },
    },