Created
March 24, 2019 16:55
-
-
Save Tenderfeel/838276734aab2e9ba746448586e920cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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