ContentLoader #

createContentLoader 返回的加载器。它是带 watch 的加载器,它的 load() 也可以不带参数调用。

字段 #

watchstring | string[]

要监听的文件的 glob 模式,或一组模式。相对路径从加载器文件所在的位置算起。

options可选DataLoaderOptions

加载器的额外选项。

load(watchedFiles?: string[]): Promise<T>

生成页面列表。不带参数时,读取 watch 匹配到的文件。

完整类型签名
TypeScript
interface ContentLoader<T = ContentData[]> extends WatchDataLoader<T> {
  watch: string | string[]
  options?: DataLoaderOptions
  load: (watchedFiles?: string[]) => Promise<T>
}

编辑此页

评论