在 Nuxt 上下文 中,你可以使用 useRequestEvent 来访问传入的请求。
useRequestEvent
// Get underlying request event const event = useRequestEvent() // Get the URL const url = event?.path
undefined
usePreviewMode
在 Nuxt 中使用 usePreviewMode 检查和控制预览模式
useRequestFetch
使用 useRequestFetch 可组合函数在服务器端发起 fetch 请求时转发请求上下文和头信息。
Community