vue-jsx-factory

6,271
Install
npm install vue-jsx-factory
Latest Version:0.3.0
Vue:2
License:MIT
Last Updated:Jan 11, 2021
Links: GitHub  ·  npm
Maintainer: jake8n

Vue JSX Factory

NPM

Compile Vue JSX and TSX with tsc or esbuild.

tsconfig.json

{
  "compilerOptions": {
    "jsx": "react",
    "jsxFactory": "j"
  }
}

Example

// j must be in scope, even though it looks unused
import { j } from "vue-jsx-factory";
import CompositionApi, { defineComponent } from "@vue/composition-api";
import Vue from "vue";

Vue.use(CompositionApi);

const App = defineComponent({
  data() {
    return {
      count: 0,
    };
  },
  render() {
    return (
      <div>
        <h1>Count {this.count}</h1>
        <button onClick={() => this.count++}>Increment</button>
      </div>
    );
  },
});

new Vue({ render: (h) => h(App) }).$mount("#app");

yarn start will create a development server, with even more examples from /src/components.

To do

  • Hot module reloading

Related Packages

esbuild-plugin-jsx

给esbuild用的vue3的jsx/tsx的解析插件

2,328 0
vue-tsx-support

TSX (JSX for TypeScript) support library for Vue

99,098 566
vtsx

支持Typescript和JSX的Vue腳手架

1,032
@hexeo/vue-typescript-jsx

Translate React JSX props into Vue VDOM data format at runtime

505 4

Version History

Version Released Vue License
0.3.0 ^2.6.12 MIT
0.2.0 ^2.6.12 MIT
0.1.1 ^2.6.12 MIT
0.1.0 ^2.6.12 MIT
0.0.2 ^2.6.12 MIT