GitXplorerGitXplorer
c

vite-jsx

public
10 stars
1 forks
3 issues

Commits

List of commits on branch master.
Unverified
6d00a04ac9c11efd765f339ad34dcb0cb61c1d29

Fix #5

ccereschen committed 4 years ago
Unverified
68316c53d424e025209b0c7ea622695175103d13

Fix #1

ccereschen committed 4 years ago
Unverified
f632c2d196714f646c284be5de91b61c5e4f104c

Fix type error

ccereschen committed 4 years ago
Unverified
ccb386366423327bdd04b55723328c7565c3250d

1.0.3

ccereschen committed 4 years ago
Unverified
d0a711136f6f77ab5b32e688633a846945637b8f

1.0.2

ccereschen committed 4 years ago
Unverified
c2aafaa4a29ddce86c0ef27d2bb5a1a038f38d23

1.0.0

ccereschen committed 4 years ago

README

The README file for this repository.

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