-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow reactive provide for the options API #2327
Comments
What is stopping you from doing what's said in the example you provided? |
@posva this link is incorrect |
The correct link is https://v3.vuejs.org/guide/component-provide-inject.html#working-with-reactivity. |
@posva What is stopping you from doing what's said in the example you provided? |
What problem does this feature solve?
Feature parity between the options and the composition APIs.
Like many I am using what is arguably the most concise and ergonomic API for Vue3 which turns out to be Vue class component. e.g vuejs/vue-class-component#465
Vue class component I believe "transpile" to the Options API and anyway the Options API needs reactive provide inject too as most existing projects will keep using it just like react hooks does not deprecate in any ways their class API.
https://v3.vuejs.org/guide/component-provide-inject.html#working-with-reactivity
From my limited understanding, reactive dependency injection require the use of the Reactivity API which come from the composition API (but shouldn't ? ) such as Vue.computed(), ref(), etc.
It is unclear to me whether this reactivity API require to be used on setup() (composition) or if it can be used inside a class component or a standard option component without transforming the component into a full boilerplatey composition api.
What does the proposed API look like?
Allowing the existing required reactivity apis (Vue.computed(), etc) inside the options API thus allowing it too in Vue class components.
The text was updated successfully, but these errors were encountered: