Created
January 4, 2022 09:58
-
-
Save 12cassie34/71e806742334adebdda4597b9858d978 to your computer and use it in GitHub Desktop.
Vue Pagination - Step2-3
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
computed: { | |
totalPages: function() { | |
return Math.ceil(this.dataAmount / this.itemsPerPage) | |
}, | |
currentContents: function() { | |
// 檢查 Array 的資料是否為空 | |
if (!this.cities || this.cities.length != this.cities.length) { | |
return; | |
} | |
this.dataAmount = this.cities.length; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment