We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用接口适配器适配各种平台,只需要传入参数 ?t= 即可
服务端属性
request阶段生成,非常适合复杂交互
export const getServerSideProps: GetServerSideProps<Props> = async (context) => { const query = context.query || {} if (query.t instanceof Array) { throw new Error("参数类型错误") } let result = [] const type = query.t || API_TYPE_CONSTANTS.API_TYPE_SIYUAN const api = new API(type) result = await api.getRecentPosts(10) return { props: { posts: result } } }
客户端属性
构建阶段生成,不适合动态变化的页面
export const getStaticProps: GetStaticProps<Props, Params> = async (context) => { // 本地测试 let pageId = "20220724172444-16a2oc1" let page = await getPage(pageId) if (!page) { page = {} } // ! is a non-null assertion const params = context.params! || {} return { props: { page: page, params: params } } }
The text was updated successfully, but these errors were encountered:
feat:#6 接口适配器
2e99470
Merge pull request #7 from terwer/dev
cde364f
terwer
No branches or pull requests
使用接口适配器适配各种平台,只需要传入参数 ?t= 即可
服务端属性
request阶段生成,非常适合复杂交互
客户端属性
构建阶段生成,不适合动态变化的页面
The text was updated successfully, but these errors were encountered: