We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 510ec9e commit cb082dfCopy full SHA for cb082df
src/components/PostCard/PostCard.vue
@@ -35,6 +35,7 @@
35
import { getCategoryColor } from "@/constants/colors";
36
import { formatDate } from "@/utils/date";
37
import type { Post } from "@/models/PostModel";
38
+import { useRouter } from "vitepress";
39
import "./PostCard.css";
40
41
interface Props {
@@ -43,7 +44,9 @@ interface Props {
43
44
45
defineProps<Props>();
46
47
+const router = useRouter();
48
+
49
function navigateToPost(url: string) {
- window.location.href = url;
50
+ router.go(url);
51
}
52
</script>
0 commit comments