Skip to content

Commit 7131bc4

Browse files
committed
separate initRender and initial mounting (fix #4693)
1 parent b60182d commit 7131bc4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/instance/init.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ export function initMixin (Vue: Class<Component>) {
3939
vm._self = vm
4040
initLifecycle(vm)
4141
initEvents(vm)
42+
initRender(vm)
4243
callHook(vm, 'beforeCreate')
4344
initState(vm)
4445
callHook(vm, 'created')
45-
initRender(vm)
46+
if (vm.$options.el) {
47+
vm.$mount(vm.$options.el)
48+
}
4649
}
4750
}
4851

src/core/instance/render.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ export function initRender (vm: Component) {
4040
// normalization is always applied for the public version, used in
4141
// user-written render functions.
4242
vm.$createElement = (a, b, c, d) => createElement(vm, a, b, c, d, true)
43-
if (vm.$options.el) {
44-
vm.$mount(vm.$options.el)
45-
}
4643
}
4744

4845
export function renderMixin (Vue: Class<Component>) {

0 commit comments

Comments
 (0)