[Vuejs]-Issue with vuejs and conditional template rendering in Laravel

0👍

seems to work if you take the for loop off the root element of the component:

<ul>
    <template>
       <div v-for="card in cards | onlyMatching">
          <li transition="expand" v-if="card.Data.event_type === 'user_comment'">
               @include('feed.card_templates.user_comment')
          </li>
          <li transition="expand" v-if="card.Data.event_type === 'user_position'">
              @include('feed.card_templates.user_position')
          </li>
       </div>
    </template>
</ul>

0👍

Vue was working as it was supposed to with the current js code. Looks like this issue was with Laravel’s blade engine and partials. Clearing the view cache seems to have fixed the issue.

Leave a comment