File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
packages/@vuepress/client/src Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ import {
1414 START_LOCATION ,
1515} from 'vue-router'
1616import type { Router } from 'vue-router'
17- import { ClientOnly , Content , OutboundLink } from './components'
1817import {
1918 siteData ,
2019 pageData ,
2120 resolvePageData ,
2221 setupUpdateHead ,
2322} from './composables'
2423import { provideGlobalComputed } from './provideGlobalComputed'
24+ import { registerGlobalComponents } from './registerGlobalComponents'
2525
2626/**
2727 * - use `createApp` in dev mode
@@ -83,14 +83,9 @@ export const createVueApp: CreateVueAppFunction = async () => {
8383 }
8484 } )
8585
86+ // global computed and global components
8687 provideGlobalComputed ( app , router )
87-
88- // register built-in components
89- /* eslint-disable vue/match-component-file-name */
90- app . component ( 'ClientOnly' , ClientOnly )
91- app . component ( 'Content' , Content )
92- app . component ( 'OutboundLink' , OutboundLink )
93- /* eslint-enable vue/match-component-file-name */
88+ registerGlobalComponents ( app )
9489
9590 // invoke all clientAppEnhances
9691 for ( const clientAppEnhance of clientAppEnhances ) {
Original file line number Diff line number Diff line change 1+ import type { App } from 'vue'
2+ import { ClientOnly , Content , OutboundLink } from './components'
3+
4+ /**
5+ * Register global built-in components
6+ */
7+ export const registerGlobalComponents = ( app : App ) : void => {
8+ /* eslint-disable vue/match-component-file-name */
9+ app . component ( 'ClientOnly' , ClientOnly )
10+ app . component ( 'Content' , Content )
11+ app . component ( 'OutboundLink' , OutboundLink )
12+ /* eslint-enable vue/match-component-file-name */
13+ }
You can’t perform that action at this time.
0 commit comments