[Vuejs]-How to create a non-empty comment node using JSX?

0👍

Although it’s not strictly JSX, I haven’t better way to achieve this:

import { Comment, h } from 'vue'

export default {
  render() {
    return (
      <strong>
        Foo
        {h(Comment, 'Baz')}
      </strong>
    )
  },
}

-1👍

This works &lt;-- Baz --&gt;

answer 2:

Babel transform will remove jsx comments,you can update your babel version, view this answer or you can use some hack

Leave a comment