vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

Partial inside component #491

Closed EmilMoe closed 8 years ago

EmilMoe commented 8 years ago

I have a component A which uses another component B. This B component allows me to use partials, so my question is, how do I register a partial only inside the scope of component A?

coblan commented 8 years ago

Vue.component('componentA',{ template:'#XXX', props:[], partials:{ dog:'<div>this is dog</div>', pig:'<div>this is pig</div>', } })

execjosh commented 8 years ago

But, what if I want the templates for the partials to come from the DOM with a selector, like with the template for the component? Does this have to be done manually?