只是想了解我为 SSR 页面指定的标题:public, s-maxage=3600, stale-while-revalidate=59
。
请注意,我的stale-while-revalidate
值是 59 秒,远小于s-maxage
1 小时的值。我想知道当stale-while-revalidate
value 小于 时s-maxage
,到底会发生什么?标题是否被stale-while-revalidate
忽略?
问题:获取双滚动条 - 删除纸张滚动条会使自动完成内容不可滚动,因此仅显示下拉列表可见高度中的内容。如果我隐藏另一个滚动,则不会调用无限滚动 API。我怎样才能让它工作:
描述 -
我正在尝试使用 Material UI Autocomplete 创建一个无限滚动,我使用react-infinite-scroll-component附加链接作为参考
我的实现方式是:
因为我们需要将无限滚动附加到呈现列表项的 Popper;因此我编写了自定义 PAPER 组件(根据文档,它负责渲染下拉列表中的项目)PaperComponent={myCustomComponent}
我的 InfiniteScrollAutoComplete 定义附在下面:
<Autocomplete
options={list.data && list.data !== null ? list.data : []}
getOptionLabel={(option) => option.name}
PaperComponent={(param) => (
<InfiniteScroll
height={200}
dataLength={list.total}
next={this.handleFetchNext.bind(this)}
hasMore={list.data.length < list.total ? true : false}
loader={
<p style={{ textAlign: "center", backgroundColor: "#f9dc01" }}>
<b>Loading...</b>
</p>
}
endMessage={
<p style={{ textAlign: "center", backgroundColor: "#f9dc01" }}>
<b>Yay! You have seen it all</b>
</p>
}
>
<Paper {...param} />
</InfiniteScroll>
)} …
Run Code Online (Sandbox Code Playgroud) autocomplete infinite-scroll material-ui react-infinite-scroll-component