I have the need to insert a comment inside a vue.js file for future references, but I don't find how you do this in the docs.
I have tried //
, /**/
, {{-- --}}
, and {# #}
, but none of them seem to work.
I am using Laravel's blade. So this is the sample_file.vue
:
<template>
<div class="media">
<like-button :post="post" v-if="post.likedByCurrentUser === false && "></like-button> {{--I want to comment this but I get an error from the gulp watch: post.canBeLikedByCurrentUser === true--}}
<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>
Does anyone know how to insert a comment and / or how to comment pieces of code?
<!-- -->
. But it sounds like you're looking for inline commenting? – ProtectiveHTML
code! Thnx – Idolla{{! comments like this }}
and{{!-- comments {{like this}} that can contain double-braces --}}
. These do not get rendered in the output, unlike<!-- html comments -->
which do. I tried both{{! ... }}
and{{!-- ... --}}
with Vue, and unfortunately they’re not supported. Would you consider adding them to your question for users who stumble upon it? – Wysocki