Socket
Socket
Sign inDemoInstall

@abusix/babel-preset-vue

Package Overview
Dependencies
8
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @abusix/babel-preset-vue

Babel preset for all Vue plugins.


Version published
Maintainers
1
Install size
1.60 MB
Created

Readme

Source

babel-preset-vue

Babel preset for all Vue plugins.

Install

npm install -D babel-preset-vue

CDN: UNPKG

Usage

In your .babelrc:

{
  "presets": ["vue"]
}

You can toggle specific features, by default all features are enabled, e.g.:

{
  "presets": [
    ["vue", {
      "eventModifiers": false
    }]
  ]
}

JSX Features

Note that following features are not available for babel v7 currently, you may disable them if necessary.

Event modifiers

Option name: eventModifiers

Uses babel-plugin-jsx-event-modifier for adding event modifiers support.

Example:

Vue.component('hello-world', {
  methods: {
    method () {
      console.log('clicked')
    }
  },
  render () {
    return (
      <div>
        <a href="/" onClick:prevent={this.method} />
      </div>
    )
  }
})

v-model

Options name: vModel

Uses babel-plugin-jsx-v-model for adding v-model support.

Example:

Vue.component('hello-world', {
  data: () => ({
    text: 'Hello World!'
  }),
  render () {
    return (
      <div>
        <input type="text" v-model={this.text} />
        {this.text}
      </div>
    )
  }
})

License

MIT © EGOIST

Keywords

FAQs

Last updated on 29 Oct 2019

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