tusen-ai / naive-ui

A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
https://www.naiveui.com
MIT License
16.25k stars 1.68k forks source link

feat(discreteApi): use app level provides to work with pinia, nuxt and latest vue #6550

Open OrbisK opened 3 days ago

OrbisK commented 3 days ago

Clear and concise description of the problem

Setup stores are also able to rely on globally provided properties like the Router or the Route. Any property provided at the App level can be accessed from the store using inject(), just like in components

https://pinia.vuejs.org/core-concepts/#Setup-Stores

with this update vue fixed a false behaviour within vue, which allowed using non app level injects https://github.com/vuejs/core/blob/main/changelogs/CHANGELOG-3.4.md#3437-2024-08-08

Suggested solution

providers in discreteApi should use app level provides

Alternative

No response

Additional context

No response

Validations

OrbisK commented 3 days ago

maybe it will work with https://vuejs.org/api/application.html#app-runwithcontext