|
|
@ -17,13 +17,7 @@ import { |
|
|
|
isRenderableAttr |
|
|
|
} from 'web/server/util' |
|
|
|
|
|
|
|
export function installSSRHelpers (vm: Component) { |
|
|
|
if (vm._ssrNode) return |
|
|
|
let Ctor = vm.constructor |
|
|
|
while (Ctor.super) { |
|
|
|
Ctor = Ctor.super |
|
|
|
} |
|
|
|
extend(Ctor.prototype, { |
|
|
|
const ssrHelpers = { |
|
|
|
_ssrEscape: escape, |
|
|
|
_ssrNode: renderStringNode, |
|
|
|
_ssrList: renderStringList, |
|
|
@ -32,7 +26,20 @@ export function installSSRHelpers (vm: Component) { |
|
|
|
_ssrDOMProps: renderDOMProps, |
|
|
|
_ssrClass: renderSSRClass, |
|
|
|
_ssrStyle: renderSSRStyle |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
export function installSSRHelpers (vm: Component) { |
|
|
|
if (vm._ssrNode) { |
|
|
|
return |
|
|
|
} |
|
|
|
let Vue = vm.constructor |
|
|
|
while (Vue.super) { |
|
|
|
Vue = Vue.super |
|
|
|
} |
|
|
|
extend(Vue.prototype, ssrHelpers) |
|
|
|
if (Vue.FunctionalRenderContext) { |
|
|
|
extend(Vue.FunctionalRenderContext.prototype, ssrHelpers) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class StringNode { |
|
|
|