Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support comment option in template #897

Merged
merged 3 commits into from
Jul 29, 2017
Merged

Conversation

Kingwl
Copy link
Member

@Kingwl Kingwl commented Jul 21, 2017

add a keyword comment to support allow keep comments in sfc:

<template comment>
  <div>
    ...
   <!-- comment -->
    ...
  </div>
</template>

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

/ping @yyx990803

@yyx990803
Copy link
Member

Changed the attribute to comments to keep it consistent with the comments option in core.

@camslice
Copy link

camslice commented Mar 6, 2020

Nice. This hasn't been added to the documentation yet as far as I can tell? Need assistance?

@mariomka
Copy link

mariomka commented May 8, 2020

It would be useful to add it to the documentation.

@JasperTey
Copy link

Is this feature available on vue-loader today? (I'm using 16.1.2)

I've been experiencing issues with HTML comments being stripped out from single file components, but only in the production build. I'm still not sure if it's a vue-loader specific behaviour, or something else in my webpack config, but this thread seems to indicate that I can control this by placing a "comments" attribute in the template tag as so: <template comments> to preserve the HTML comments within? That did not seem to make a difference, which confuses me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants