Vue Composition API
ref()
for reactive primitives, reactive()
for reactive objects (arrays/maps/etc.). ref()
is some kind of a wrapper around reactive()
.
When using ref()
, get proxy’s value with .value
:
|
|
If you use reactive()
, you can’t reassign. Also see
ref vs reactive in Vue 3?