1.0.6 • Published 4 years ago

vite-jsx v1.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

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

  • v-if
  • v-else-if
  • v-else
  • v-show
  • v-text
  • v-html
  • v-model

    modifiers : sync, number, trim, lazy

    example : v-model_value = v-model:value

    v-model_trim_number = v-model.trim.number

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

  • performance optimization
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago