cereschen / vite-jsx

Help use directives such as v-if in the jsx of vite
MIT License
10 stars 1 forks source link

vite-jsx

Help use directives such as v-if in the jsx of vite

Usage

Run npm install vite-jsx

or yarn add vite-jsx

Add to vite.config.js

import { createJsxPlugin } from "vite-jsx/plugin"

 module.exports = {
  plugins: [createJsxPlugin()],
  ...
}

Directives

IntelliSense

add to your *.d.ts

 declare namespace JSX {
  interface IntrinsicAttributes {
    ['v-if']?: unknown
    ['v-else-if']?: unknown
    ['v-else']?: unknown
    ['v-show']?: unknown
    ['v-html']?: unknown
    ['v-text']?: unknown
    ['v-model']?: unknown
  }
}

TODO