question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vue2.4 set comments true, don't work

See original GitHub issue

Version

2.4.1

Reproduction link

https://codepen.io/anon/pen/dREmrV

Steps to reproduce

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

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

vue-cli comments:true The comment is gone

What is expected?

see link

What is actually happening?

use vue-cli The comment is gone

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
yyx990803commented, Jul 21, 2017

Ah, we forgot to mention in the docs: the comments option only works when using the full build with in-browser compilation. It does not work in single file components.

5reactions
Kingwlcommented, Jul 21, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to comment code in a vue.js file? - Stack Overflow
Any solution for Vue 3? The config "comments: true" doesn't work here. – Rafael S. Fijalkowski. Feb 18, 2021 at 15: ...
Read more >
API - Vue.js
Details: When set to true , will preserve and render HTML comments found in templates. The default behavior is discarding them. Instance Properties....
Read more >
How to Migrate from Vue CLI to Vite - Vue School Blog
Learn how to migrate from Vue CLI to Vite in 9 simple steps for a faster and more streamlined developer experience.
Read more >
Documenting components - Vue Styleguidist
For events documentation, add a comment right above it. If your comment is at the start of the function, the event will not...
Read more >
Composition api or Options api? - DEV Community 👩‍💻👨‍💻
I don't see why we distinguish between OptA (Options API) and ... But, sometimes I work on a Vue 2 project for a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found