Closed djkloop closed 3 years ago
You're most likely using ref
/reactive
outside setup or before vue is initialized.
// composables/test.ts
import { ref } from '@vue/composition-api'
const store = ref({}) // <- this will cause an error, because javascript will run before vue is initialized.
function useStore(){
return ref({}) // works if called inside of setup or after vue initialized
}
You're most likely using
ref
/reactive
outside setup or before vue is initialized.// composables/test.ts import { ref } from '@vue/composition-api' const store = ref({}) // <- this will cause an error, because javascript will run before vue is initialized. function useStore(){ return ref({}) // works if called inside of setup or after vue initialized }
you are right...
What's the fix if I need to have a global ref variable?