vuejs / rfcs

RFCs for substantial changes / feature additions to Vue core
4.87k stars 546 forks source link

Can "vue 3" support "jsx fragment"? #158

Closed masx200 closed 4 years ago

masx200 commented 4 years ago

Can "vue 3" support "jsx fragment"?

import { h, ref, reactive } from "vue";

export default {
  setup() {
    const count = ref(0);
    const object = reactive({ foo: "bar" });

    return () => {
      return (
        <>
          <p>{count.value}</p>
          <div>hello world</div>
          <h1>{object.foo}</h1>
        </>
      );
    };
  },
};
yyx990803 commented 4 years ago

This is just a syntax level thing, which is trivial to support in the JSX babel transform. It isn't complete yet but this will definitely be supported.