Skip to content

Instantly share code, notes, and snippets.

@Tenderfeel
Created March 24, 2019 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tenderfeel/838276734aab2e9ba746448586e920cc to your computer and use it in GitHub Desktop.
Save Tenderfeel/838276734aab2e9ba746448586e920cc to your computer and use it in GitHub Desktop.
<template>
<div id="app">
<div class="content">
<ol>
<li v-for="(item, i) in items" :key="i">{{item}}</li>
</ol>
</div>
</div>
</template>
<script>
export default {
name: "App",
components: {},
data() {
const items = new Array(200).fill(null).map((e, i) => `Item ${i + 1}`);
const perPage = 10;
return {
items, //表示するデータがここに入る
page: 1, //現在のページ番号
perPage, //1ページ毎の表示件数
totalPage: Math.ceil(items.length / perPage), //総ページ数
count: items.length //itemsの総数
};
}
};
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
margin-top: 60px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment