Git Product home page Git Product logo

babel-sugar-v-bind-sync's Introduction

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 -D babel-sugar-v-bind-sync
# for npm:
npm install babel-sugar-v-bind-sync --save-dev

In your .babelrc:

module.exports = {
  plugins: [require('babel-sugar-v-bind-sync')]
}

Details

This plugin adds v-bind sync modifier 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 (prop_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 {
      bar: 'naz',
    };
  },
  render(h) {
    return (
      <div>
        <component foo_sync={this.bar} />
      </div>
    );
  },
};

babel-sugar-v-bind-sync's People

Contributors

mitscherlich avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar

babel-sugar-v-bind-sync's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4
  • actions/cache v4
npm
package.json
  • @babel/plugin-syntax-jsx ^7.16.7
  • camelcase ^8.0.0
  • @babel/core 7.24.3
  • @babel/preset-env 7.24.3
  • @rollup/plugin-babel 6.0.4
  • @vue/babel-plugin-transform-vue-jsx 1.4.0
  • parcel 2.12.0
  • prismjs 1.29.0
  • regenerator-runtime 0.14.1
  • rollup 2.79.1
  • rollup-plugin-terser 7.0.2
  • vitest 0.34.6

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.