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

babel-sugar-v-bind-sync

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-sugar-v-bind-sync

Babel syntactic sugar for v-bind sync modifier support in Vue JSX

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

babel-sugar-v-bind-sync

Syntactic sugar for v-bind sync modifier in JSX.

Babel Compatibility Notes

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

Usage

Install the dependencies:

# for yarn:
yarn add babel-sugar-v-bind-sync
# for npm:
npm install babel-sugar-v-bind-sync --save

In your .babelrc:

{
  "plugins": ["babel-sugar-v-bind-sync"]
}

Details

This plugin adds v-bind sync feature to the JSX and tries to mirror the same behavior as in vue-template-compiler, with a few differences:

  1. You should use underscore (_) instead of dot (.) for sync modifier (foo_sync={this.bar})
  2. It is recommended to use camelCase version of it (propName_sync) in JSX, but you can use kebab-case too (prop-name_sync).
export default {
  data() {
    return {
      test: 'something',
    };
  },
  render(h) {
    return (
      <div>
        <component visible_sync={this.test} />
      </div>
    );
  },
};

FAQs

Package last updated on 14 Feb 2021

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