vitepress
vitepress copied to clipboard
layout-slots don't support top-level-await
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
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.
能否将doc左侧的sidebar也做成插槽,并且将sidebar的数据暴漏出来,供外部使用