Nuxt/docs/modules/content/runtime/index.ts

8 lines
219 B
TypeScript
Raw Normal View History

2021-04-20 12:16:09 +00:00
import { asyncData } from '@nuxt/app'
export { default as NuxtContent } from './content.vue'
export function useContent (slug) {
return asyncData(`content:${slug}`, () => globalThis.$fetch(`/api/content${slug}`))
}