Nuxt 공식문서 번역/Composables
useRequestEvent
Tech정개블
2023. 12. 14. 10:41
페이지, 컴포넌트 및 플러그인 내에서 useRequestEvent 를 이용하여, 들어오는 요청에 액세스하는 데 사용할 수 있다.
// Get underlying request event
const event = useRequestEvent()
// Get the URL
const url = event.path
브라우저에서 userRequestEvent 를 호출하면 undefined 가 반환된다.