vue-jsx-best-practices

Align Vue 3 JSX syntax with Vue conventions for attributes and events.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/hello-lizhihua/skills_zh-CN --skill vue-jsx-best-practices-hello-lizhihua
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-jsx-best-practices
Source: https://github.com/hello-lizhihua/skills_zh-CN/tree/main/vue-skills/cn/skills/vue-jsx-best-practices
Command: npx skills add https://github.com/hello-lizhihua/skills_zh-CN --skill vue-jsx-best-practices-hello-lizhihua

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Vue JSX often blends React conventions with Vue JSX, leading to incorrect attributes and typing issues.

Core Features & Use Cases

  • Provides guidance to write Vue-friendly JSX/TSX using standard HTML attributes (class, for) and Vue-style event handling.
  • Includes TypeScript configuration tips and Vite plugin setup to enable Vue JSX support in Vue 3 projects.
  • Useful when converting React JSX to Vue JSX or authoring new Vue components with JSX.

Quick Start

Convert a React JSX component to Vue JSX by replacing className with class, htmlFor with for, and adapting event handlers to Vue-style (onClick/onInput) with proper TSX typing.

Frequently Asked Questions about vue-jsx-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Vue 3 JSX components with correct attributes and event handlers?

To write Vue 3 JSX components, use standard HTML attributes like class and for instead of React's className and htmlFor, and apply Vue-style event handlers such as onClick and onInput to ensure proper TSX typing and alignment with Vue conventions.

What's the best way to convert React JSX to Vue JSX?

The best way to convert React JSX to Vue JSX involves replacing className with class, htmlFor with for, and adapting event handlers to Vue-style syntax like onClick, while configuring TypeScript and Vite for Vue JSX typing support.

Why does my Vue TSX component have typing issues with standard HTML attributes?

Vue TSX typing issues occur when blending React conventions with Vue JSX, such as using className instead of class; aligning JSX syntax with Vue conventions and configuring TypeScript correctly resolves these attribute typing conflicts.

Do I need a Vite plugin to enable Vue JSX support in a TypeScript project?

Yes, you need to set up the correct Vite plugin and TypeScript configuration to enable Vue JSX support, ensuring that TSX files are properly typed and compiled within your Vue 3 project environment.

Can I use React JSX conventions like htmlFor directly in Vue 3 components?

No, you should not use React conventions like htmlFor in Vue 3; Vue JSX requires standard HTML attributes such as for and class to align with Vue's internal rendering and avoid incorrect attribute mapping.