0
Follow
0
View

How to specify useFetch data return type in Nuxt

dafeiqiu 注册会员
2023-01-25 09:52

You can give a type to useFetch to define the return type

Like:

  interface APIBody {
    /* properties defined here */
  }

  const {data} = await useFetch("api_url here")

About the Author

Question Info

Publish Time
2023-01-25 09:52
Update Time
2023-01-25 09:52