From ac100de8d8e0fc85e34cde9aec6262259b12f96c Mon Sep 17 00:00:00 2001 From: Cristiano Magro <cristiano.magro@vola.it> Date: Mon, 30 Dec 2024 21:53:48 +0100 Subject: [PATCH] style scoped locali --- 08 - component communication/cmp-communication-assignment-solution/src/components/UserData.vue | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/08 - component communication/cmp-communication-assignment-solution/src/components/UserData.vue b/08 - component communication/cmp-communication-assignment-solution/src/components/UserData.vue new file mode 100644 index 0000000..25017d1 --- /dev/null +++ b/08 - component communication/cmp-communication-assignment-solution/src/components/UserData.vue @@ -0,0 +1,26 @@ +<template> + <section> + <form @submit.prevent="submitData"> + <input type="text" placeholder="Your name" v-model="enteredName" /> + <input type="text" placeholder="Your age" v-model="enteredAge" /> + <button>Set User Data</button> + </form> + </section> +</template> + +<script> +export default { + emits: ['set-data'], + data() { + return { + enteredName: "", + enteredAge: "", + }; + }, + methods: { + submitData() { + this.$emit('set-data', this.enteredName, this.enteredAge); + } + } +}; +</script> \ No newline at end of file -- Gitblit v1.8.0