import { useEffect } from "react"; import { Link, useLoaderData } from "@remix-run/react"; import { json, type MetaFunction } from "@remix-run/node"; export const meta: MetaFunction = () => { return [ { title: "日记" }, { name: "description", content: "奇趣保罗的日常笔记" }, ]; }; export async function loader() { const note = await fetch("https://paul.ren/api/note").then((res) => res.json()) as API.Response; return json(note); } export default function Note() { const note = useLoaderData(); useEffect(() => { console.log(note); }, []); return (

日记

{note.data.map((item) => { const year = item.date.substring(0, 4); return (

{item.title}

{item.except}

{item.date}

继续阅读
); })}
); }