[Vuejs]-How can I compile the inner component as a child in Vue.js?

0👍

In this case i’d use local registration for the child component. Instead of making it global you can register it locally like:

// extend and register in one step
Vue.component('my-component', {
  template: '<div>A custom component!</div>'
})

// also works for local registration
var Parent = Vue.extend({
  components: {
    'my-component': {
      template: '<div>A custom component!</div>'
    }
  }
})

You don’t have to register every component globally. You can make a component available only in the scope of another component by registering it with the components instance option:

http://vuejs.org/guide/components.html#Local-Registration

Leave a comment