Browse Source

fix(ui): refresh home article list on tag query change

main
Mohan 1 month ago
parent
commit
4b41723853
  1. 10
      src/views/HomeView.vue

10
src/views/HomeView.vue

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ref, onMounted, watch } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { articleApi } from '@/api/client' import { articleApi } from '@/api/client'
import { ArticleStatus, type ArticleListItem } from '@/generated/api' import { ArticleStatus, type ArticleListItem } from '@/generated/api'
@ -39,6 +39,14 @@ function onPageChange(p: number) {
} }
onMounted(load) onMounted(load)
watch(
() => route.query.tag,
() => {
page.value = 1
load()
}
)
</script> </script>
<template> <template>

Loading…
Cancel
Save