ITADN

Vue provide/inject error when slots are used from Astro

#17598ClosedHoolean 创建于 25 天前
pkg: vuepkg: astro- P2: has workaroundtriage: unable to fix
H
Hooleancommented
### Astro Info ```block Astro v7.1.6 Node v22.22.3 System Linux (x64) Package Manager unknown Output static Adapter none Integrations @astrojs/vue ``` ### If this issue only occurs in one browser, which browser is a problem? _No response_ ### Describe the Bug In Vue, `provide` can be used to supply a value that a child component can `inject` to receive. Child components may be provided through slots. Where `<Outer>` provides, and `<Inner>` injects, the following works when embedded in Vue, but not in Astro: ``` <Outer> <Inner /> </Outer> ``` In particular, this stack trace is shown on the server-side: ``` [Vue warn]: injection "thing" not found. at <Inner > at <App> ``` ### What's the expected result? The behaviour would be the same whether the component is embedded by Astro or Vue: the `provide` and `inject` execute in the correct order, with a shared context. In particular, accessing this from Astro is necessary to pass an Astro component deeply through a slot. ### Link to Minimal Reproducible Example https://stackblitz.com/edit/github-csq4y65y?file=src%2Fpages%2Fworking.astro&file=src%2Fpages%2Fbroken.astro ### Participation - [ ] I am willing to submit a pull request for this issue.
关闭于 22 天前 3 条评论