🐛 fix push is not defined

This commit is contained in:
目棃
2024-12-06 19:17:35 +08:00
parent a69fb8ca50
commit a54f2f5f53

View File

@@ -39,6 +39,7 @@ import showSnackbar from "../func/snackbar.js";
type ToChannelProps = { gid?: string; curType?: string; modelValue: boolean }; type ToChannelProps = { gid?: string; curType?: string; modelValue: boolean };
type ToChannelEmits = (e: "update:modelValue", v: boolean) => void; type ToChannelEmits = (e: "update:modelValue", v: boolean) => void;
const router = useRouter();
const props = withDefaults(defineProps<ToChannelProps>(), { modelValue: false }); const props = withDefaults(defineProps<ToChannelProps>(), { modelValue: false });
const emits = defineEmits<ToChannelEmits>(); const emits = defineEmits<ToChannelEmits>();
const { recentNewsType } = storeToRefs(useAppStore()); const { recentNewsType } = storeToRefs(useAppStore());
@@ -61,7 +62,7 @@ async function toChannel(item: ToChannelItem): Promise<void> {
link = link.replace("{type}", "notice"); link = link.replace("{type}", "notice");
recentNewsType.value = "notice"; recentNewsType.value = "notice";
} }
await useRouter().push(link); await router.push(link);
} }
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>