commit | author | age
|
b63e90
|
1 |
<!DOCTYPE html> |
CM |
2 |
<html lang="en"> |
|
3 |
<head> |
|
4 |
<meta charset="UTF-8" /> |
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
|
6 |
<title>Vue Basics</title> |
|
7 |
<link |
|
8 |
href="https://fonts.googleapis.com/css2?family=Jost:wght@400;700&display=swap" |
|
9 |
rel="stylesheet" |
|
10 |
/> |
|
11 |
<link rel="stylesheet" href="styles.css" /> |
|
12 |
<script src="https://unpkg.com/vue@next" defer></script> |
|
13 |
<script src="app.js" defer></script> |
|
14 |
</head> |
|
15 |
<body> |
|
16 |
<header> |
|
17 |
<h1>FriendList</h1> |
|
18 |
</header> |
|
19 |
<section id="app"> |
|
20 |
<ul> |
|
21 |
<li v-for="friend in friends" :key="friend.id"> |
|
22 |
<h2>{{ friend.name }}</h2> |
|
23 |
<button @click="toggleDetails()"> |
|
24 |
{{ detailsAreVisible ? 'Hide' : 'Show' }} Details |
|
25 |
</button> |
|
26 |
<ul v-if="detailsAreVisible"> |
|
27 |
<li><strong>Phone:</strong> {{ friend.phone }}</li> |
|
28 |
<li><strong>Email:</strong> {{ friend.email }}</li> |
|
29 |
</ul> |
|
30 |
</li> |
|
31 |
</ul> |
|
32 |
</section> |
|
33 |
</body> |
|
34 |
</html> |