Skip to content

Commit

Permalink
ready -> mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 10, 2016
1 parent 2021b1f commit 5a5c7eb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/select2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Vue.component('select2', {
props: ['options', 'value'],
template: '#select2-template',
ready: function () {
mounted: function () {
var vm = this
$(this.$el)
.val(this.value)
Expand Down
1 change: 0 additions & 1 deletion src/core/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default {
'created',
'beforeMount',
'mounted',
'ready',
'beforeUpdate',
'updated',
'beforeDestroy',
Expand Down
5 changes: 3 additions & 2 deletions src/core/instance/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ export function lifecycleMixin (Vue) {
}
}
}
callHook(this, 'beforeMount')
this._watcher = new Watcher(this, this._render, this._update)
this._update(this._watcher.value)
this._mounted = true
// root instance, call ready on self
// root instance, call mounted on self
if (this.$root === this) {
callHook(this, 'ready')
callHook(this, 'mounted')
}
return this
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/vdom/create-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function prepatch (oldVnode, vnode) {
}

function insert (vnode) {
callHook(vnode.child, 'ready')
callHook(vnode.child, 'mounted')
}

function destroy (vnode) {
Expand Down

0 comments on commit 5a5c7eb

Please sign in to comment.