0

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.

http://jsbin.com/wurofatuve/1/edit?html,js,output

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.