Socket
Socket
Sign inDemoInstall

@vue/babel-sugar-inject-h

Package Overview
Dependencies
55
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @vue/babel-sugar-inject-h

Babel syntactic sugar for h automatic injection for Vue JSX


Version published
Weekly downloads
896K
increased by3.27%
Maintainers
3
Install size
18.9 kB
Created
Weekly downloads
 

Readme

Source

@vue/babel-sugar-inject-h

Syntactic sugar for automatic h inject in JSX.

Babel Compatibility Notes

  • This repo is only compatible with Babel 7.x, for 6.x please use vuejs/babel-plugin-transform-vue-jsx

Usage

Install the dependencies:

# for yarn:
yarn add @vue/babel-sugar-inject-h
# for npm:
npm install @vue/babel-sugar-inject-h --save

In your .babelrc:

{
  "plugins": ["@vue/babel-sugar-inject-h"]
}

However it is recommended to use the configurable preset instead.

Details

This plugin automatically injects h in every method that has JSX. By using this plugin you don't have to always specifically declare h as first parameter in your render() function.

// Without @vue/babel-sugar-inject-h
export default {
  render (h) {
    return <button />
  }
}

// With @vue/babel-sugar-inject-h
export default {
  render () {
    return <button />
  }
}

FAQs

Last updated on 25 Aug 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc