use _isServer flag to determine whether __path__ should be noop

This commit is contained in:
Evan You 2016-05-11 13:00:16 -04:00
parent 76d06ba422
commit 4dc42357e4

View File

@ -1,11 +1,11 @@
import Vue from 'core/index'
import config from 'core/config'
import { createPatchFunction } from 'core/vdom/patch'
import * as nodeOps from 'web/runtime/node-ops'
import platformDirectives from 'web/runtime/directives/index'
import baseModules from 'core/vdom/modules/index'
import platformModules from 'web/runtime/modules/index'
import { query, isUnknownElement, isReservedTag } from 'web/util/index'
import { inBrowser } from 'core/util/env'
import { noop } from 'core/util/index'
// install platform specific utils
@ -17,9 +17,9 @@ Vue.options.directives = platformDirectives
// install platform patch function
const modules = baseModules.concat(platformModules)
Vue.prototype.__patch__ = inBrowser
? createPatchFunction({ nodeOps, modules })
: noop
Vue.prototype.__patch__ = config._isServer
? noop
: createPatchFunction({ nodeOps, modules })
// wrap mount
Vue.prototype.$mount = function (el) {