Skip to content

Commit fb13864

Browse files
committed
refactor($core): move layout components registration to app.js
1 parent 5f1eb0e commit fb13864

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/@vuepress/core/lib/app/app.js

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import globalUIComponents from '@internal/global-ui'
99
import ClientComputedMixin from '@transform/ClientComputedMixin'
1010
import VuePress from './plugins/VuePress'
1111
import { handleRedirectForCleanUrls } from './redirect.js'
12+
import { getLayoutAsyncComponent } from './util'
1213

1314
// built-in components
1415
import Content from './components/Content.js'
@@ -42,6 +43,9 @@ Vue.component('ContentSlotsDistributor', ContentSlotsDistributor)
4243
Vue.component('OutboundLink', OutboundLink)
4344
// component for client-only content
4445
Vue.component('ClientOnly', ClientOnly)
46+
// core components
47+
Vue.component('Layout', getLayoutAsyncComponent('Layout'))
48+
Vue.component('NotFound', getLayoutAsyncComponent('NotFound'))
4549

4650
// global helper for adding base path to absolute urls
4751
Vue.prototype.$withBase = function (path) {

packages/@vuepress/core/lib/app/components/LayoutDistributor.vue

-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
</template>
44

55
<script>
6-
import Vue from 'vue'
76
import { getLayoutAsyncComponent } from '../util'
87
9-
Vue.component('Layout', getLayoutAsyncComponent('Layout'))
10-
Vue.component('NotFound', getLayoutAsyncComponent('NotFound'))
11-
128
export default {
139
computed: {
1410
layout () {

0 commit comments

Comments
 (0)