Skip to content
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

layout-slots don't support top-level-await #1229

Closed
alamhubb opened this issue Aug 23, 2022 · 2 comments
Closed

layout-slots don't support top-level-await #1229

alamhubb opened this issue Aug 23, 2022 · 2 comments
Labels
enhancement New feature or request question This is a question rather than an issue or pull request stale

Comments

@alamhubb
Copy link

alamhubb commented Aug 23, 2022

Describe the bug

https://vitepress.vuejs.org/guide/theme-introduction#layout-slots

I wrote a custom component with reference to myLayout, I used top-level-await in the component, and then the view could not be displayed

I'm not sure if this issue is related to the following issues

#599

@alamhubb alamhubb added the bug: pending triage Maybe a bug, waiting for confirmation label Aug 23, 2022
@brc-dd
Copy link
Member

brc-dd commented Aug 23, 2022

Using top-level await will make Layout an async component, then we'll need Suspense to properly render it (which is experimental BTW). It would be better to just create an async component for your slot and use suspense only inside named template instead of using it for whole layout. Alternatively, use something like refs and onBeforeMount to accomplish whatever you want.

@brc-dd brc-dd added enhancement New feature or request question This is a question rather than an issue or pull request and removed bug: pending triage Maybe a bug, waiting for confirmation labels Aug 23, 2022
@didoee
Copy link

didoee commented Sep 9, 2022

能否将doc左侧的sidebar也做成插槽,并且将sidebar的数据暴漏出来,供外部使用

@github-actions github-actions bot added the stale label Aug 3, 2023
@brc-dd brc-dd closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request question This is a question rather than an issue or pull request stale
Projects
None yet
Development

No branches or pull requests

3 participants