quick format
This commit is contained in:
@@ -26,7 +26,12 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</v-table>
|
</v-table>
|
||||||
<v-pagination :length="pageCount" @prev="previousPage()" @next="nextPage()" @update:modelValue="setPage($event)"></v-pagination>
|
<v-pagination
|
||||||
|
:length="pageCount"
|
||||||
|
@prev="previousPage()"
|
||||||
|
@next="nextPage()"
|
||||||
|
@update:modelValue="setPage($event)"
|
||||||
|
></v-pagination>
|
||||||
<button @click="previousPage()">pp</button>
|
<button @click="previousPage()">pp</button>
|
||||||
<button @click="nextPage()">np</button>
|
<button @click="nextPage()">np</button>
|
||||||
</template>
|
</template>
|
||||||
@@ -69,9 +74,9 @@ function nextPage() {
|
|||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPage(targetPage:number) {
|
function setPage(targetPage: number) {
|
||||||
this.page=targetPage - 1
|
this.page = targetPage - 1
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|||||||
@@ -19,7 +19,12 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</v-table>
|
</v-table>
|
||||||
<v-pagination :length="pageCount" @prev="previousPage()" @next="nextPage()" @update:modelValue="setPage($event)"></v-pagination>
|
<v-pagination
|
||||||
|
:length="pageCount"
|
||||||
|
@prev="previousPage()"
|
||||||
|
@next="nextPage()"
|
||||||
|
@update:modelValue="setPage($event)"
|
||||||
|
></v-pagination>
|
||||||
</template>
|
</template>
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|
||||||
@@ -33,10 +38,10 @@ const games = ref({})
|
|||||||
const pageCount = ref({})
|
const pageCount = ref({})
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
const response = await axios.post('/api/game', {
|
const response = await axios.post('/api/game', {
|
||||||
page: `${page}`,
|
page: `${page}`,
|
||||||
count: '10',
|
count: '10',
|
||||||
orderBy: 'id'
|
orderBy: 'id'
|
||||||
})
|
})
|
||||||
|
|
||||||
games.value = response.data.gameData
|
games.value = response.data.gameData
|
||||||
@@ -53,9 +58,9 @@ async function previousPage() {
|
|||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPage(targetPage:number) {
|
function setPage(targetPage: number) {
|
||||||
this.page=targetPage - 1
|
this.page = targetPage - 1
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user