I am trying to add a render a template using the push mutation method. I want to push a section component, but instead of the template content I get the raw output of <vsection></vsection'. Can anyone help me render the actual template content and not the raw tags? I included a jsbin below.
Add a comment
|
1 Answer
You're thinking about this a little oddly. What I think you'd be better off doing is putting a v-for on a <vsection> component.
<vsection v-for="section in sections">
{{ section.content }}
</vsection>
This way, when you push content to sections it'll out put another one. You'll also have to adjust your section component so you can use the content.
<template id="section-template">
<div class="section">
<slot></slot>
</div>
</template>
Here it is working like I think you want: http://jsbin.com/suhadidobe/1/edit?html,js,output
1 Comment
Juan Rangel
Hey Bill, thank you for your reply, I didn't get a notification so sorry for the delay in response. Ultimately what I am trying to do is stack templates. So the user sees a list of buttons and when clicking a button that specific template will be added. I am going to try and make it work with what you provided. Thank you again for your response.