Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit 29188ba

Browse files
committed
feat: multiple accounts split page
1 parent 12fc3d2 commit 29188ba

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

src/pages/Characters.vue

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@
1010
>
1111
<span class="align-middle"> , you have {{ characters.length }} characters, choose one to continue</span>
1212
</p>
13-
<CharacterCard
14-
class="character mt-4 cursor-pointer mb-5"
15-
v-for="character in characters"
16-
:character="character"
17-
:key="character.username"
18-
@click="choose(character)"
19-
/>
13+
<div class="my-5">
14+
<CharacterCard
15+
class="character mt-4 cursor-pointer mb-5"
16+
v-for="character in characters.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
17+
:character="character"
18+
:key="character.username"
19+
@click="choose(character)"
20+
/>
21+
<el-pagination
22+
class="justify-center"
23+
background
24+
layout="prev, pager, next"
25+
:total="characters.length"
26+
hide-on-single-page
27+
:page-size="pageSize"
28+
v-model:current-page="currentPage"
29+
/>
30+
</div>
2031
<el-card class="relative cursor-pointer font-bold text-center" shadow="hover" @click="router.push('/mint')">
2132
+ Mint Another One
2233
</el-card>
@@ -44,6 +55,9 @@ if (store.state.settings.address) {
4455
const address = `${store.state.settings.address!.slice(0, 6)}...${store.state.settings.address!.slice(-4)}`;
4556
const loading = ref(false);
4657
58+
const currentPage = ref(1);
59+
const pageSize = ref(5);
60+
4761
const choose = async (character: Profile) => {
4862
loading.value = true;
4963
await store.dispatch('setSettings', {

0 commit comments

Comments
 (0)