-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
66 lines (64 loc) · 2.01 KB
/
index.html
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Starting Vue JS</title>
<script src="https://unpkg.com/[email protected]"></script>
<style>
body{
background: #eee;
max-width: 960px;
margin: 20px auto;
}
p, h3, ul {
margin: 0;
padding: 0;
}
li{
list-style-type: none;
background: #fff;
margin: 20px auto;
padding: 10px 20px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
li.fav{
background: #ff9ed2;
color: white;
}
</style>
</head>
<body>
<h1>Hello Vue JS 3</h1>
<div id="app">
<!-- <a :href="url">One of website</a> -->
<div v-if="showBooks">
<ul>
<!-- <li v-for="book in books" :class="{fav: book.isFav}" @click="changeFav(book)"> -->
<li v-for="book in filteredBooks" :class="{fav: book.isFav}" @click="changeFav(book)">
<img :src="book.img" alt="book.title">
<h3>{{ book.title }}</h3>
<p>{{ book.author }}</p>
</li>
</ul>
<!-- <button v-on:click="age++">Increase age</button>
<button v-on:click="age--">Decrease age</button>
<p @click="changeTitle('Oathbringer')">Change the title</p> -->
</div>
<button @click="toggleShowBooks">
<span v-if="showBooks">Hide Books</span>
<span v-else>Show Books</span>
</button>
<!--
<div class="box" @mouseover="handleEvent($event,5)">mouseover</div>
<div class="box" @mouseleave="handleEvent">mouseleave</div>
<div class="box" @dblclick="handleEvent">double click</div>
<div class="box" @mousemove>handleMouseMove</div> -->
</div>
<script src="app.js"></script>
</body>
</html>