diff --git a/src/components/pageNews/to-channel.vue b/src/components/pageNews/to-channel.vue index 212ff3b4..79362ab4 100644 --- a/src/components/pageNews/to-channel.vue +++ b/src/components/pageNews/to-channel.vue @@ -39,6 +39,7 @@ import showSnackbar from "../func/snackbar.js"; type ToChannelProps = { gid?: string; curType?: string; modelValue: boolean }; type ToChannelEmits = (e: "update:modelValue", v: boolean) => void; +const router = useRouter(); const props = withDefaults(defineProps(), { modelValue: false }); const emits = defineEmits(); const { recentNewsType } = storeToRefs(useAppStore()); @@ -61,7 +62,7 @@ async function toChannel(item: ToChannelItem): Promise { link = link.replace("{type}", "notice"); recentNewsType.value = "notice"; } - await useRouter().push(link); + await router.push(link); }