Browse Source

增加定时任务

dev
沈明 1 year ago
parent
commit
8cc63e6e9b
  1. 15
      src/pages/electionList/index.vue

15
src/pages/electionList/index.vue

@ -1,5 +1,7 @@
<script setup lang="ts">
import { getVoteList } from '@/api/common'
const reListRef = ref()
const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params })
const doSearch = (formData: { page: number; limit: number }, onSuccess: Function) => {
getVoteList(formData).then((res) => {
@ -7,6 +9,19 @@ const doSearch = (formData: { page: number; limit: number }, onSuccess: Function
onSuccess({ data })
})
}
const setInerval = ref<any>()
onShow(() => {
setInerval.value = setInterval(() => {
reListRef.value.refreshFn()
}, 5000)
})
onHide(() => {
clearInterval(setInerval.value)
setInerval.value = null
})
</script>
<template>

Loading…
Cancel
Save