In Vue.js files, comments can be added in different parts of the file depending on where you want to place them:
<template> <div class="media"> <!-- This is a comment inside the template block --> <like-button :post="post" v-if="post.likedByCurrentUser === false"></like-button> <div class="media-left"> <a href="#"> <img class="media-object" v-bind:src="post.user.avatar" v-bind:title="post.user.name + ' image from Gravatar'"> </a> </div> <div class="media-body"> <strong>{{ post.user.name }}</strong> <p>{{ post.body }}</p> <p>{{ post.likeCount }} {{ pluralize('like', post.likeCount) }}</p> </div> </div> </template>
Block:
You mentioned using Laravel’s Blade and having issues with Vue comments and Blade comments. In your case, the comment syntax for Vue template () should work. However, Blade comments are different and not valid within Vue’s .
Here is how you can comment properly inside your Vue component: