commit | author | age
|
bc995b
|
1 |
<template> |
CM |
2 |
|
|
3 |
<section> |
|
4 |
<header> |
|
5 |
Esercizio |
|
6 |
</header> |
|
7 |
<active-user :username="user.username" :age="user.age"></active-user> |
ff5308
|
8 |
<user-data @update-user="updateUser"></user-data> |
bc995b
|
9 |
</section> |
CM |
10 |
</template> |
|
11 |
|
|
12 |
<script> |
|
13 |
export default { |
|
14 |
data() { |
|
15 |
return { |
|
16 |
user: { |
|
17 |
username: "mario", |
|
18 |
age: "38", |
|
19 |
} |
|
20 |
} |
ff5308
|
21 |
}, |
CM |
22 |
methods:{ |
|
23 |
updateUser(user, age){ |
|
24 |
this.user.username = user; |
|
25 |
this.user.age = age; |
|
26 |
} |
bc995b
|
27 |
} |
CM |
28 |
} |
|
29 |
</script> |
|
30 |
|
|
31 |
<style> |
|
32 |
@import url('https://fonts.googleapis.com/css2?family=Jost&display=swap'); |
|
33 |
|
|
34 |
* { |
|
35 |
box-sizing: border-box; |
|
36 |
} |
|
37 |
|
|
38 |
html { |
|
39 |
font-family: 'Jost', sans-serif; |
|
40 |
} |
|
41 |
|
|
42 |
body { |
|
43 |
margin: 0; |
|
44 |
} |
|
45 |
|
|
46 |
header { |
|
47 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26); |
|
48 |
margin: 3rem auto; |
|
49 |
border-radius: 10px; |
|
50 |
padding: 1rem; |
|
51 |
background-color: #58004d; |
|
52 |
color: white; |
|
53 |
text-align: center; |
|
54 |
width: 90%; |
|
55 |
max-width: 40rem; |
|
56 |
} |
|
57 |
|
|
58 |
#app ul { |
|
59 |
margin: 0; |
|
60 |
padding: 0; |
|
61 |
list-style: none; |
|
62 |
} |
|
63 |
|
|
64 |
#app li, |
|
65 |
#app form { |
|
66 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26); |
|
67 |
margin: 1rem auto; |
|
68 |
border-radius: 10px; |
|
69 |
padding: 1rem; |
|
70 |
text-align: center; |
|
71 |
width: 90%; |
|
72 |
max-width: 40rem; |
|
73 |
} |
|
74 |
|
|
75 |
#app h2 { |
|
76 |
font-size: 2rem; |
|
77 |
border-bottom: 4px solid #ccc; |
|
78 |
color: #58004d; |
|
79 |
margin: 0 0 1rem 0; |
|
80 |
} |
|
81 |
|
|
82 |
#app button { |
|
83 |
font: inherit; |
|
84 |
cursor: pointer; |
|
85 |
border: 1px solid #ff0077; |
|
86 |
background-color: #ff0077; |
|
87 |
color: white; |
|
88 |
padding: 0.05rem 1rem; |
|
89 |
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.26); |
|
90 |
} |
|
91 |
|
|
92 |
#app button:hover, |
|
93 |
#app button:active { |
|
94 |
background-color: #ec3169; |
|
95 |
border-color: #ec3169; |
|
96 |
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.26); |
|
97 |
} |
|
98 |
|
|
99 |
#app input { |
|
100 |
font: inherit; |
|
101 |
padding: 0.15rem; |
|
102 |
} |
|
103 |
|
|
104 |
#app label { |
|
105 |
font-weight: bold; |
|
106 |
margin-right: 1rem; |
|
107 |
width: 7rem; |
|
108 |
display: inline-block; |
|
109 |
} |
|
110 |
|
|
111 |
#app form div { |
|
112 |
margin: 1rem 0; |
|
113 |
} |
|
114 |
</style> |