vueJsxCompat.js 570 B

12345678910111213
  1. import { createVNode, isVNode } from 'vue';
  2. if (import.meta.env.MODE === 'development') {
  3. console.log(`[vue tip] You are using an non-optimized version of Vue 3 JSX, ` +
  4. `which does not take advantage of Vue 3's runtime fast paths. An improved ` +
  5. `JSX transform will be provided at a later stage.`);
  6. }
  7. const slice = Array.prototype.slice;
  8. export function jsx(tag, props = null, children = null) {
  9. if (arguments.length > 3 || isVNode(children)) {
  10. children = slice.call(arguments, 2);
  11. }
  12. return createVNode(tag, props, children);
  13. }