From fb09dca31f9a64ca4287579006014157a3d8156c Mon Sep 17 00:00:00 2001 From: Cristiano Magro <cristiano.magro@vola.it> Date: Sat, 28 Dec 2024 22:39:21 +0100 Subject: [PATCH] specifica dettagliata dei parametri e validatore custom --- 07 - development setup/vue-cli-01-a-new-vue-project/src/components/FriendContact.vue | 35 +++++++++++++++++++++++++++++------ 1 files changed, 29 insertions(+), 6 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 c10fcf8..e01781a 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 @@ -17,12 +17,35 @@ <script> export default { - props: [ - 'name', - 'phoneNumber', - 'emailAddress', - 'isFavorite' - ], + // props: [ + // 'name', + // 'phoneNumber', + // 'emailAddress', + // 'isFavorite' + // ], + props: { + name: { + title: String, + required: true + }, + phoneNumber: { + title: String, + required: true + }, + emailAddress: { + title: String, + required: true + }, + isFavorite: { + title: String, + required: false, + default: '0', + validator: function (value) { + return value === '1' || value === '0'; + } + }, + }, + data() { return { detailsAreVisible: false, -- Gitblit v1.8.0