We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
<Content />
1 parent 976c2b8 commit 83b02baCopy full SHA for 83b02ba
packages/@vuepress/core/lib/client/components/Content.js
@@ -1,4 +1,5 @@
1
-import { setGlobalInfo } from '@app/util'
+import Vue from 'vue'
2
+import { setGlobalInfo, getPageAsyncComponent } from '@app/util'
3
4
export default {
5
props: {
@@ -12,6 +13,14 @@ export default {
12
13
const pageKey = this.pageKey || this.$parent.$page.key
14
setGlobalInfo('pageKey', pageKey)
15
16
+ /**
17
+ * This is for use cases that render `<Content />`
18
+ * with dynamic pageKey from current $page.
19
+ */
20
+ if (!Vue.component(pageKey)) {
21
+ Vue.component(pageKey, getPageAsyncComponent(pageKey))
22
+ }
23
+
24
if (pageKey) {
25
return h(pageKey)
26
}
0 commit comments