0 votes
in VueJS by
What is the purpose of comments option?

1 Answer

0 votes
by

When comments option enabled, it will preserve and render HTML comments found in templates. By default, it's value is false. Let's see the action in an example,

<template>
  <div class="greeting">
    <!--greeting-->
    <h1>{{ msg }}</h1>
  </div>
</template>

<script>
export default {
  comments: true,
  data () {
    return {
      msg: 'Good morning'
    }
  }
}
</script>

Note: This option is only available in the full build, with in-browser compilation. i.e, It won't work with Single File Components(SFC).

Related questions

0 votes
asked Sep 9, 2023 in VueJS by AdilsonLima
0 votes
asked Sep 15, 2023 in VueJS by JackTerrance
...