From 9d0151483b330f7931d46ed9ad4c501e7e47d289 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 10 Mar 2019 04:29:08 +0800 Subject: [PATCH] fix($core): cannot render another page with pageKey (close: #1173) Error: Unknown Custom Element - --- packages/@vuepress/core/lib/client/components/Content.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/@vuepress/core/lib/client/components/Content.js b/packages/@vuepress/core/lib/client/components/Content.js index c2ed88d487..c0ffc38af2 100644 --- a/packages/@vuepress/core/lib/client/components/Content.js +++ b/packages/@vuepress/core/lib/client/components/Content.js @@ -1,4 +1,5 @@ -import { isPageExists } from '../util' +import Vue from 'vue' +import { isPageExists, getPageAsyncComponent } from '../util' export default { props: { @@ -11,6 +12,7 @@ export default { render (h) { const pageKey = this.pageKey || this.$parent.$page.key if (isPageExists(pageKey)) { + Vue.component(pageKey, getPageAsyncComponent(pageKey)) return h(pageKey) } return h('')