Skip to content

Commit 2a59800

Browse files
zthxxxulivz
authored andcommitted
fix($core): '[Vue warn]: Unknown custom element' when using <Content /> in a custom page without markdown (#1699)
**Bug**: example, , will raise `[Vue warn]: Unknown custom element`, like #1173 #1426 **Reason**: because it not inject any content in `@internal/page-components` while not find markdown file, `Vue.component` of `pageKey` must be `undefined`, then `h(pageKey)` raise this error **Fix**: judge as `if (Vue.component(pageKey))`, unnecessary to render if no component existed
1 parent 984a1a8 commit 2a59800

File tree

1 file changed

+1
-1
lines changed
  • packages/@vuepress/core/lib/client/components

1 file changed

+1
-1
lines changed

packages/@vuepress/core/lib/client/components/Content.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default {
2121
Vue.component(pageKey, getPageAsyncComponent(pageKey))
2222
}
2323

24-
if (pageKey) {
24+
if (Vue.component(pageKey)) {
2525
return h(pageKey)
2626
}
2727
return h('')

0 commit comments

Comments
 (0)