mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-04 04:57:40 +08:00
renderLinks -> renderResourceHints
This commit is contained in:
parent
e5814dee67
commit
4f9f28cf16
@ -65,7 +65,7 @@ export default class TemplateRenderer {
|
||||
|
||||
bindRenderFns (context: Object) {
|
||||
const renderer: any = this
|
||||
;['Links', 'State', 'Scripts', 'Styles'].forEach(type => {
|
||||
;['ResourceHints', 'State', 'Scripts', 'Styles'].forEach(type => {
|
||||
context[`render${type}`] = renderer[`render${type}`].bind(renderer, context)
|
||||
})
|
||||
}
|
||||
@ -81,7 +81,7 @@ export default class TemplateRenderer {
|
||||
return (
|
||||
template.head(context) +
|
||||
(context.head || '') +
|
||||
this.renderLinks(context) +
|
||||
this.renderResourceHints(context) +
|
||||
this.renderStyles(context) +
|
||||
template.neck(context) +
|
||||
content +
|
||||
@ -104,7 +104,7 @@ export default class TemplateRenderer {
|
||||
return context.styles || ''
|
||||
}
|
||||
|
||||
renderLinks (context: Object): string {
|
||||
renderResourceHints (context: Object): string {
|
||||
return this.renderPreloadLinks(context) + this.renderPrefetchLinks(context)
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ export default class TemplateStream extends Transform {
|
||||
}
|
||||
|
||||
// inline preload/prefetch directives for initial/async chunks
|
||||
const links = this.renderer.renderLinks(this.context)
|
||||
const links = this.renderer.renderResourceHints(this.context)
|
||||
if (links) {
|
||||
this.push(links)
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ describe('SSR: template option', () => {
|
||||
createRendererWithManifest('split.js', {
|
||||
runInNewContext,
|
||||
template: `<html>` +
|
||||
`<head>{{{ renderLinks() }}}</head>` +
|
||||
`<head>{{{ renderResourceHints() }}}</head>` +
|
||||
`<body><!--vue-ssr-outlet-->{{{ renderScripts() }}}</body>` +
|
||||
`</html>`,
|
||||
inject: false
|
||||
@ -303,7 +303,7 @@ describe('SSR: template option', () => {
|
||||
|
||||
const customOutput =
|
||||
`<html><head>${
|
||||
context.renderLinks()
|
||||
context.renderResourceHints()
|
||||
}</head><body>${
|
||||
res +
|
||||
context.renderScripts()
|
||||
|
Loading…
Reference in New Issue
Block a user