How to comment code in a vue.js file?
You'd want to use standard HTML comments in the <template>
tag in your situation. They'll be stripped from the output as well which is nice.
<!-- Comment -->
As Bill Criswell said we can use HTML comment syntax.
<!-- Comment -->
But, It will work outside the template tag too,comment.vue
<!-- Testing comments, this will work too. --><template> <!-- This will work too --> <div> <!-- Html Comments --> Hello There! </div></template><style><style><!-- Commenting here --><script> // Commenting only 1 line /** * Commenting multiple lines * Commenting multiple lines */</script>
I have just tested this:
<template> {{ /* this is a comment */ }} <h1>Hello world</h1></template>