Skip to content

Instantly share code, notes, and snippets.

View kt2763's full-sized avatar
🏠
Working from home

Keisuke Tanabe kt2763

🏠
Working from home
View GitHub Profile
@kt2763
kt2763 / nuxtjs-pagination-component.vue
Created November 24, 2017 21:35
Nuxt.js Pagination
<template>
<nav id="pagination">
<ul class="page-numbers" v-if="$store.state.totalPageCount">
<li v-for="num in this.pageNumbers" v-if="num != null" v-bind:style="{ width: (100 / pageNumberCount) + '%' }">
<nuxt-link v-if="num != $route.query.page && num != currentPage" :to="{ path: '/', query: { page: num } }">{{ num }}</nuxt-link>
<span v-else>{{ num }}</span>
</li>
</ul>
<ul class="page-guides" v-if="this.$store.state.totalPageCount != 1">
<li>
@kt2763
kt2763 / nuxtjs-wp-rest-api-list.vue
Last active November 24, 2017 13:55
Vue.jsでWP REST APIを叩いてみる
<template>
<section>
<articles />
<pagination />
</section>
</template>
<script>
import Articles from '~/components/Articles.vue'
import Pagination from '~/components/Pagination.vue'