-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[vue] vue渲染模板时怎么保留模板中的HTML注释呢? #508
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
Labels
vue
vue
Comments
|
<template comments>
...
</template> |
|
... |
|
... |
设置comments属性,官网默认为舍弃注释 |
... <script> import... export default{ comments: true, ... } </script> |
注释必须位于要保留的根元素内。 |
<template comments>
<!--我是注释内容-->
</template> <script>
export default {
comments: true;
}
</script> |
comments设为true,默认false,设为true之后将会保留且渲染模块中的HTML注释, |
Vue默认舍弃注释,可以通过设置comments来开启,相关文档
注释一定要在根元素之内
这样注释是不生效的。这是vue-loader提供的支持 或者
注意:在单文件组件设置是不生效的
|
1.使用注释: 在 Vue 模板中,可以使用 注释,这种注释会被保留在渲染后的 HTML 中。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[vue] vue渲染模板时怎么保留模板中的HTML注释呢?
The text was updated successfully, but these errors were encountered: