vuejs / composition-api

Composition API plugin for Vue 2
https://composition-api.vuejs.org/
MIT License
4.19k stars 343 forks source link

`provide` with symbol not work #900

Closed yaquawa closed 2 years ago

yaquawa commented 2 years ago

I can't provide() value with symbol, is this intended?

it gives such an error: [Vue warn]: injection "undefined" not found.

reproduce: https://codesandbox.io/s/vue-2-composition-api-forked-k7unx?file=/src/App.vue

xiaoxiangmoe commented 2 years ago

This is because you have a circular dependency. Avoid circular dependency, please.

Move export const ConditionIK = Symbol("Condition"); to another new file and import it.

https://codesandbox.io/s/vue-2-composition-api-forked-td0cm