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

Skip to content

Commit de6459f

Browse files
committed
lifecycle: add init hook
1 parent 98e16a0 commit de6459f

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
@@ -90,6 +90,9 @@ exports._init = function (options) {
9090
// it will be filled up in _initScope().
9191
this._data = {}
9292

93+
// call init hook
94+
this._callHook('init')
95+
9396
// initialize data observation and scope inheritance.
9497
this._initState()
9598

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