0

I've trouble using components and child components in Vue.js. I can't get the correct DOM using child components and v-repeats at the custom tags. This is my code: http://laravel.io/bin/rowQx

I can't understand even though I've scratched my head for hours why the repeated role-user tags are placed after the form-group but before the entire table. The placement of the tags is before . Why so? Why does it not land in the components in as I thought since it's where it's placed. Any ideas?

1
  • I think the reason behind this is that you're not allowed to put <role-user> tags inside a tbody since it executes as invalid table html output. Anyone who have experience in fixing this? Commented Jul 1, 2015 at 7:48

3 Answers 3

1

At the moment this issue is solvable. Check the code and manual article.

<tr is="role-user" v-for="user in usersList"></tr>

I'm not sure if v-for won't break in here. As a workaround, you can use template.

<template v-for="user in usersList">
    <tr is="role-user"></tr>
</template>
Sign up to request clarification or add additional context in comments.

Comments

0

You need to put the content Tag in your User-Table view to render the nested child. Place it in the Position where you want to render it like the yield in laravel

7 Comments

As you can see in this link there's a tag in the users-table laravel.io/bin/rowQx#78 :)
What do you mean with the Content Tag? Could you please try to take my code and give me a hint after you've edited it?
Sorry at this Moment i am only on Phone. But when i am home i will give you an example
Try this, it's untested and i hope it is working laravel.io/bin/1y6Kj#79-80
Thanks. But what should it do? I already have my child component role-user which doesn't appends correctly in that tbody. Why should <content> do so?
|
0

The solution was to go away with a div structure. I think it's not possible to add a tbody / table rows when the html is already rendered.

Comments

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.