The following code will produce an empty comment node i.e. <!---->.
How to produce a non-empty comment node e.g. <!-- Foo --> using h?
export default {
render(h) {
return h(null)
},
}
The following code will produce an empty comment node i.e. <!---->.
How to produce a non-empty comment node e.g. <!-- Foo --> using h?
export default {
render(h) {
return h(null)
},
}
h(null) with string as second argumentexport default {
render(h) {
return h(null, 'This is a comment') // <!--This is a comment-->
},
}
h(Comment) with string as second argumentimport { h, Comment } from 'vue' // Vue 3
export default {
render() {
return h(Comment, 'This is a comment') // <!--This is a comment-->
},
}
createCommentVNode() with string as argumentimport { createCommentVNode } from 'vue' // Vue 3
export default {
render() {
return createCommentVNode('This is a comment') // <!--This is a comment-->
},
}