Created
July 18, 2020 19:32
-
-
Save IgorDePaula/346e7e0de7b875048855faad7b05688a 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 v-for="item in list" :key="item">{{item}}</div> | |
<button @click="setPage(page-1)" :disabled="page==1">Anterior</button> | |
{{page}}/500 | |
<button @click="setPage(page+1)" :disabled="page>list.length-1">Proximo</button> | |
{{page}} | |
</div> | |
</template> | |
<script> | |
export default { | |
name: "App", | |
data() { | |
return { | |
list: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
page: 1 | |
}; | |
}, | |
methods: { | |
setPage(page) { | |
this.page = page; | |
} | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment