前端winter、杨村长、然叔mini-vue手写实战
每个 page 不是默认导出一个函数么?
把 getStaticProps 声明在这个函数旁边即可
栗子🌰:
export const getStaticProps: GetStaticProps = async () => {
const posts = await getPosts()
return {
props: {
posts,
}
}}
必须按照这个格式,不能变(命名和返回值{ props: {...} })