Cristiano Magro
2024-12-30 ac100de8d8e0fc85e34cde9aec6262259b12f96c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<template>
    <form @submit.prevent="submitData">
        <div>
            <label>Nome:</label>
            <input type="text" v-model="name" /><br>
        </div>
        <div>
            <label>Phone:</label>
            <input type="tel" v-model="phone" /><br>
        </div>
        <div>
            <label>Email:</label>
            <input type="email" v-model="email" /><br>
        </div>
        <div>
            <button>Add new friend</button>
        </div>
    </form>
</template>
 
<script>
export default {
    data() {
        return {
            name: "",
            phone: "",
            email: "",
        }
    },
    emits: ['add-contact'],
    methods: {
        submitData() {
            this.$emit('add-contact', this.name, this.phone, this.email);
        }
    }
}
</script>
 
<style></style>