Skip to content

Commit 03b580e

Browse files
committed
use pre-hook for setting up prop two-way sync (fix #2064)
1 parent fa53d96 commit 03b580e

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/directives/internal/prop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default {
4646
// important: defer the child watcher creation until
4747
// the created hook (after data observation)
4848
var self = this
49-
child.$once('hook:created', function () {
49+
child.$once('pre-hook:created', function () {
5050
self.childWatcher = new Watcher(
5151
child,
5252
childKey,

src/directives/public/cloak.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
bind () {
33
var el = this.el
4-
this.vm.$once('hook:compiled', function () {
4+
this.vm.$once('pre-hook:compiled', function () {
55
el.removeAttribute('v-cloak')
66
})
77
}

src/instance/internal/events.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export default function (Vue) {
159159
*/
160160

161161
Vue.prototype._callHook = function (hook) {
162+
this.$emit('pre-hook:' + hook)
162163
var handlers = this.$options[hook]
163164
if (handlers) {
164165
for (var i = 0, j = handlers.length; i < j; i++) {

0 commit comments

Comments
 (0)