Skip to content

Commit cb082df

Browse files
committed
fix: client side routing으로 수정
1 parent 510ec9e commit cb082df

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/PostCard/PostCard.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import { getCategoryColor } from "@/constants/colors";
3636
import { formatDate } from "@/utils/date";
3737
import type { Post } from "@/models/PostModel";
38+
import { useRouter } from "vitepress";
3839
import "./PostCard.css";
3940
4041
interface Props {
@@ -43,7 +44,9 @@ interface Props {
4344
4445
defineProps<Props>();
4546
47+
const router = useRouter();
48+
4649
function navigateToPost(url: string) {
47-
window.location.href = url;
50+
router.go(url);
4851
}
4952
</script>

0 commit comments

Comments
 (0)