Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vitejs/plugin-vue-jsx

Package Overview
Dependencies
Maintainers
4
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-vue-jsx

Provides Vue 3 JSX & TSX support with HMR.

  • 2.0.0-beta.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
408K
decreased by-41.94%
Maintainers
4
Weekly downloads
 
Created

What is @vitejs/plugin-vue-jsx?

@vitejs/plugin-vue-jsx is a Vite plugin that provides support for Vue 3 JSX syntax. It allows developers to write Vue components using JSX, which can be more familiar to those coming from a React background or those who prefer JSX syntax over Vue's template syntax.

What are @vitejs/plugin-vue-jsx's main functionalities?

Basic JSX Support

This feature allows you to write Vue components using JSX syntax. The code sample demonstrates a simple Vue component that renders a div with the text 'Hello, JSX!'.

import { defineComponent } from 'vue';

const MyComponent = defineComponent({
  render() {
    return <div>Hello, JSX!</div>;
  }
});

export default MyComponent;

Props Handling

This feature allows you to define and use props in your JSX components. The code sample shows a component that takes a 'message' prop and renders it inside a div.

import { defineComponent } from 'vue';

const MyComponent = defineComponent({
  props: {
    message: String
  },
  render() {
    return <div>{this.message}</div>;
  }
});

export default MyComponent;

Event Handling

This feature allows you to handle events in your JSX components. The code sample demonstrates a button that shows an alert when clicked.

import { defineComponent } from 'vue';

const MyComponent = defineComponent({
  methods: {
    handleClick() {
      alert('Button clicked!');
    }
  },
  render() {
    return <button onClick={this.handleClick}>Click me</button>;
  }
});

export default MyComponent;

Other packages similar to @vitejs/plugin-vue-jsx

FAQs

Package last updated on 21 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc