1
0
Fork 0
mirror of https://github.com/silenty4ng/k5web synced 2025-04-19 08:39:56 +00:00
This commit is contained in:
Silent YANG 2024-05-27 01:24:13 +08:00
parent 14b5b5b0f4
commit 43af220237
2 changed files with 16 additions and 23 deletions
src/views/idea
firmware
image

View file

@ -29,7 +29,7 @@
</template>
</a-list-item>
</a-list>
<t-pagination style="margin: 10px;" :total="state.total" :current="state.page" showPageNumber :showPageSize="false" />
<t-pagination @change="loadit" style="margin: 10px;" :total="state.total" :current="state.page" :pageSize="12" showPageNumber :showPageSize="false" />
</a-card>
</a-col>
</a-row>
@ -128,18 +128,15 @@
})
onMounted(async ()=>{
const resp : any = await axios.get("https://k5.vicicode.com/wsapi/list?type=0&page=" + state.page + "&t=" + Date.now())
state.total = resp.total
state.nowpage = resp.data
loadit({current: 1})
})
watch(state, async (n, o)=>{
if(n.page != o.page){
const resp : any = await axios.get("https://k5.vicicode.com/wsapi/list?type=0&page=" + state.page + "&t=" + Date.now())
state.total = resp.total
state.nowpage = resp.data
}
})
const loadit = async (page: any) => {
state.page = page.current
const resp : any = await axios.get("https://k5.vicicode.com/wsapi/list?type=0&limit=12&page=" + page.current + "&t=" + Date.now())
state.total = resp.total
state.nowpage = resp.data
}
const showPanel = async () => {
state.refLoading = true;

View file

@ -39,7 +39,7 @@
</t-card>
</a-col>
</a-row>
<t-pagination style="margin: 10px;" :total="state.total" :current="state.page" :pageSize="12" showPageNumber :showPageSize="false" />
<t-pagination @change="loadit" style="margin: 10px;" :total="state.total" :current="state.page" :pageSize="12" showPageNumber :showPageSize="false" />
</a-card>
</a-col>
</a-row>
@ -140,11 +140,15 @@
})
onMounted(async ()=>{
const resp : any = await axios.get("https://k5.vicicode.com/wsapi/list?type=1&limit=12&page=" + state.page + "&t=" + Date.now())
state.total = resp.total
state.nowpage = resp.data
loadit({current: 1})
})
const loadit = async (page: any) => {
state.page = page.current
const resp : any = await axios.get("https://k5.vicicode.com/wsapi/list?type=1&limit=12&page=" + page.current + "&t=" + Date.now())
state.total = resp.total
state.nowpage = resp.data
}
const showPanel = async () => {
state.refLoading = true;
@ -204,14 +208,6 @@
const refit = () => {
showPanel()
}
watch(state, async (n, o)=>{
if(n.page != o.page){
const resp : any = await axios.get("https://k5.vicicode.com/wsapi/list?type=1&limit=12&page=" + state.page + "&t=" + Date.now())
state.total = resp.total
state.nowpage = resp.data
}
})
const useImg = (url:any) => {
router.push({