Subscribe on changes!

How to use options API along with Composition API in vue3?

avatar
Mar 30th 2022

Version

3.2.31

Reproduction link

sfc.vuejs.org/

Steps to reproduce

click the button, reactive msg variable doesn't change as expected.

What is expected?

when click button, console log ref msg variable, and change it to 'ok!'

What is actually happening?

console log msg is undefined(in my local workstation) click doesn't seem to work


when development(vite), everything works as expected.
after build(vite build) and deploy, it doesn't work!

avatar
Mar 30th 2022

As pointed out in other issues: you don't use both apis on the same component. You can use both apis in the same project thought.


Remember to use the forum or the Discord chat to ask questions!