|
|
@@ -50,9 +50,6 @@ export function initLifecycle (vm: Component) {
|
|
|
export function lifecycleMixin (Vue: Class<Component>) {
|
|
|
Vue.prototype._update = function (vnode: VNode, hydrating?: boolean) {
|
|
|
const vm: Component = this
|
|
|
- if (vm._isMounted) {
|
|
|
- callHook(vm, 'beforeUpdate')
|
|
|
- }
|
|
|
const prevEl = vm.$el
|
|
|
const prevVnode = vm._vnode
|
|
|
const prevActiveInstance = activeInstance
|
|
|
@@ -197,7 +194,13 @@ export function mountComponent (
|
|
|
// we set this to vm._watcher inside the watcher's constructor
|
|
|
// since the watcher's initial patch may call $forceUpdate (e.g. inside child
|
|
|
// component's mounted hook), which relies on vm._watcher being already defined
|
|
|
- new Watcher(vm, updateComponent, noop, null, true /* isRenderWatcher */)
|
|
|
+ new Watcher(vm, updateComponent, noop, {
|
|
|
+ before () {
|
|
|
+ if (vm._isMounted) {
|
|
|
+ callHook(vm, 'beforeUpdate')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, true /* isRenderWatcher */)
|
|
|
hydrating = false
|
|
|
|
|
|
// manually mounted instance, call mounted on self
|