Skip to content

Commit

Permalink
fix: analyze table paginator
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Oct 21, 2023
1 parent 0929495 commit 44d3141
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/auto-import.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ declare global {
const h: typeof import('vue')['h']
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
const inject: typeof import('vue')['inject']
const injectLocal: typeof import('@vueuse/core')['injectLocal']
const isDefined: typeof import('@vueuse/core')['isDefined']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
Expand Down Expand Up @@ -73,6 +74,7 @@ declare global {
const onUpdated: typeof import('vue')['onUpdated']
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
const provide: typeof import('vue')['provide']
const provideLocal: typeof import('@vueuse/core')['provideLocal']
const reactify: typeof import('@vueuse/core')['reactify']
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
const reactive: typeof import('vue')['reactive']
Expand Down
7 changes: 7 additions & 0 deletions src/views/analyze/components/analyze-data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ export const AnalyzeDataTable = defineComponent({
setHeaderButtons(null)
})
})
watch(
() => route.query.page,
async (n) => {
await fetchData(n ? +n : 1)
},
)

const {
data,
pager,
Expand Down
10 changes: 0 additions & 10 deletions src/views/analyze/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
toRaw,
watch,
} from 'vue'
import { useRoute } from 'vue-router'
import type { IPAggregate, Month, Path, Today, Total, Week } from './types'

import { Chart } from '@antv/g2/esm'
Expand All @@ -24,15 +23,6 @@ const SectionTitle = defineComponent((_, { slots }) => () => (
))
export default defineComponent({
setup() {
const route = useRoute()
watch(
() => route.query.page,
async (n) => {
// @ts-expect-error
await fetchData(n)
},
)

// graph
const count = ref({} as Total)
const todayIp = ref<string[]>()
Expand Down

0 comments on commit 44d3141

Please sign in to comment.