Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
How to assign an interface to a useFetch object Vuejs 3 and Nuxtjs 3

How to assign an interface to a useFetch object Vuejs 3

Interface

export interface ProdutoInterface {
  codigo: number
  nome: string
}

Componente

const { data: produto, error } = await useFetch(config.API_BASE_URL+`/produto`)

I can't get it to work. Would anyone know how to help me.

thank you very much for your attention

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use fetch accepts an generic type:

const { data: produto, error } = await <ProdutoInterface>useFetch(config.API_BASE_URL+`/produto`)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!