iamshaunjp / iamshaunjp/nuxt-3-tutorial

The backend uses FastAPI, and the returned data is right, but cannot get data in NUXT 3

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
133
Forks
77
PR merge metrics
No merged PRs in 30d

Description

My backend uses FastAPI, API return data like:
```
{"posts":
[
{"id":4370,"title":"cute-bar-2","date":"2023-03-02","tags":"{color-pages,archive,bears}"},
{"id":854,"title":"bat-12","date":"2023-03-01","tags":"{color-pages,archive,bats}"},
...
],
"page":1,
"page_size":20,
"total_pages":232
}

```

script:
```

const { data: colorpages } = await useFetch('http://localhost:8000/color-pages')

```

return:
```
RefImpl {
__v_isShallow: false,
dep: undefined,
__v_isRef: true,
_rawValue: null,
_value: null
}
```

```{{p.title}}``` page no rendered

But in FastAPI http://127.0.0.1:8000/docs, data return is right

HOW SHOULD I DO? please

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.