You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
704 B
TypeScript
28 lines
704 B
TypeScript
2 years ago
|
import Vue from './instance/index'
|
||
|
import { initGlobalAPI } from './global-api/index'
|
||
|
import { isServerRendering } from 'core/util/env'
|
||
|
import { FunctionalRenderContext } from 'core/vdom/create-functional-component'
|
||
|
import { version } from 'v3'
|
||
|
|
||
|
initGlobalAPI(Vue)
|
||
|
|
||
|
Object.defineProperty(Vue.prototype, '$isServer', {
|
||
|
get: isServerRendering
|
||
|
})
|
||
|
|
||
|
Object.defineProperty(Vue.prototype, '$ssrContext', {
|
||
|
get() {
|
||
|
/* istanbul ignore next */
|
||
|
return this.$vnode && this.$vnode.ssrContext
|
||
|
}
|
||
|
})
|
||
|
|
||
|
// expose FunctionalRenderContext for ssr runtime helper installation
|
||
|
Object.defineProperty(Vue, 'FunctionalRenderContext', {
|
||
|
value: FunctionalRenderContext
|
||
|
})
|
||
|
|
||
|
Vue.version = version
|
||
|
|
||
|
export default Vue
|