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

vue-model-on

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-model-on

Allows you to set the event type when binding model data in Vue.js

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vue-model-on for Vue 2.x

By default Vue's v-model uses the input event to update the underlying model data, vue-model-on is a simple directive that allows you to set the event type for updating model data in Vue.js. Simply use v-model-on:event="myVar" instead of v-model="myVar" to set up your two way binding.

Install

Install via npm:

npm install vue-model-on

Then simply use require:

require('vue-model-on')

or import for ES6 syntax:

import "vue-model-on"

Also available via CDN on unpkg, simply add the following to your page:

<script src="https://unpkg.com/vue-model-on@latest/dist/vue-model-on.js" ></script>

Example

The following will update myVar on blur event, although you may use any javascript event you want to:

HTML

<input v-model-on:blur="myVar" />

Vue Instance

new Vue({
  el: '#app',
  data: {
    myVar: '' // declare model variable
  }
});

Check it out on JSFiddle

Keywords

FAQs

Package last updated on 05 Apr 2017

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