8000 lifecycle: add init hook · Aphasia-GitHub/vue@4498289 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4498289

Browse files
committed
lifecycle: add init hook
1 parent 30196ee commit 4498289

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/instance/init.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ exports._init = function (options) {
9595
// it will be filled up in _initScope().
9696
this._data = {}
9797

98+
// call init hook
99+
this._callHook('init')
100+
98101
// initialize data observation and scope inheritance.
99102
this._initState()
100103

src/util/options.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ strats.el = function (parentVal, childVal, vm) {
108108
* Hooks and param attributes are merged as arrays.
109109
*/
110110

111+
strats.init =
111112
strats.created =
112113
strats.ready =
113114
strats.attached =

0 commit comments

Comments
 (0)
0