[Vuejs]-V-for depending on tag

3👍

Do this and you should be fine . Change the p tag to div

<body>
        <div id="app">
            <div v-for="referee in referees">
                Name: {{referee.name}}<br>
                Match count: {{ referee.matches.length}}

                <!-- If I use span here, everything works just fine -->
                <div v-for="match in referee.matches">{{match.date}}</div>

                <!-- But if I switch to div, it no longer works -->
                <!--div v-for="match in referee.matches">{{match.date}}</div-->
            </div>
        </div>
    </body>

You can’t have div inside a p

Leave a comment