-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
50 lines (50 loc) · 1.4 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Load more Posts Vue + WP REST API</title>
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css"
/>
</head>
<body>
<section id="app" class="wrapper">
<div class="container">
<div class="box" style="margin-top: 50px">
<h1 class="title">{{ greeting }}</h1>
<h3 v-if="page > 0">Showing Page {{ page }} of {{ totalPages }}</h3>
<progress
v-if="page > 0"
class="progress"
:value="page"
:max="totalPages"
>
{{ page }}
</progress>
<posts v-if="posts">
<post
v-for="post in posts"
:key="post.id"
class="post"
:id="'post' + post.id"
:title="post.title.rendered"
:permalink="post.link"
>
</post>
</posts>
<button
:class="isLoading + ' ' + 'button is-primary'"
v-if="show"
@click="getPosts(page)"
>
Load Posts
</button>
</div>
</div>
</section>
<script src="app.js"></script>
</body>
</html>