Skip to content

Ready hook is not called when used together with v-if #561

Closed
@jsedlacek

Description

@jsedlacek

When I create a component using v-component directive together with v-if the ready hook is not called.

var ready = spy();
var parent = new Vue({
  template: '<user-profile v-if="showProfile"></user-profile>',
  data: {
    showProfile: false
  },
  components: {
    'user-profile': {
      template: 'User Profile...',
      ready: ready
    }
  }
})
parent.$mount()
parent.$appendTo(document.body)
parent.showProfile = true;

Vue.nextTick(function() {
  assert(ready.called);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions