https://github.com/simon-he95/unplugin-jsx-if
https://github.com/simon-he95/unplugin-jsx-if
jsx-syntax react unplugin unplugin-jsx-if
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/simon-he95/unplugin-jsx-if
- Owner: Simon-He95
- License: mit
- Created: 2024-07-31T02:21:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-31T02:57:00.000Z (over 1 year ago)
- Last Synced: 2025-03-07T17:52:20.401Z (10 months ago)
- Topics: jsx-syntax, react, unplugin, unplugin-jsx-if
- Language: TypeScript
- Homepage: https://unplugin-jsx-if.netlify.app/
- Size: 126 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: license
Awesome Lists containing this project
README
## unplugin-jsx-if
在 react 项目中使用 vue 的 v-if 语法 🍬
### [demo](./playground/src/pages/index.tsx)
## Install
```bash
npm i unplugin-jsx-if -d
```
## Usage
```ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import vitePluginJsxSugarIf from 'unplugin-jsx-if/vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), vitePluginJsxSugarIf({ prefix: 'v' /* 可以是任意的, 会检测 xx-if xxx-else-if xxx-else */ })],
})
```
## :coffee:
[buy me a cup of coffee](https://github.com/Simon-He95/sponsor)
## License
[MIT](./license)
## Sponsors