Subscribe on changes!

reactive issues with external library works in Option Api but not in Composition Api

avatar
Apr 21st 2021

Version

3.0.11

Reproduction link

https://codesandbox.io/s/wizardly-curie-olkqv

Steps to reproduce

See code sandbox calling the api results in the component not rendering using composition API.

What is expected?

all APIs should work

What is actually happening?

only Options Api works


Note: I also had to wrap the results in JSON parse/ stringify to get raw JSON object as the models being constructed were causing reactive errors. It appears the model has functions and other properties that Vue doesn't like.

I've been using Vue 3 composite API for months this is the first time I've ever seen this.

avatar
Apr 21st 2021

You must use async setup with Suspense component https://codesandbox.io/s/hungry-bash-vczqp?file=/src/App.vue. Otherwise, setup cannot be async.