-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat($core): 'contentLoading' site config option
- Loading branch information
Showing
7 changed files
with
65 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Vue from 'vue' | ||
import components from '@internal/page-components' | ||
|
||
export default { | ||
functional: true, | ||
props: { | ||
pageKey: String, | ||
slotKey: String | ||
}, | ||
render (h, { parent, props, data }) { | ||
const pageKey = props.pageKey || parent.$page.key | ||
if (components[pageKey]) { | ||
// In SSR, if a component is not registered with the component option | ||
// vue-server-renderer will not be able to resovle it. | ||
if (!parent.$ssrContext) { | ||
Vue.component(pageKey, components[pageKey]) | ||
} | ||
return h(pageKey, { | ||
class: [data.class, data.staticClass], | ||
style: data.style, | ||
props: { | ||
slotKey: props.slot || 'default' | ||
} | ||
}) | ||
} | ||
return h('') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters