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 - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

2

dist/vue-model-on.js

@@ -1,1 +0,1 @@

Vue.directive("model-on",{bind:function(e,n,i){e.addEventListener(n.arg,function(){i.context[n.expression]=e.value})}});
Vue.directive("model-on",{bind:function(e,n,t){e.value=t.context[n.expression],e.addEventListener(n.arg,function(){t.context[n.expression]=e.value})},update:function(e,n,t){e.value=t.context[n.expression]}});
{
"name": "vue-model-on",
"version": "1.0.2",
"version": "1.1.0",
"description": "Allows you to set the event type when binding model data in Vue.js",

@@ -5,0 +5,0 @@ "main": "src/vue-model-on.js",

# 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"`
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.

@@ -9,3 +9,3 @@ ## Install

`npm install vue-model-on --save-dev`
`npm install vue-model-on`

@@ -22,3 +22,3 @@ Then simply use `require`:

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

@@ -45,3 +45,3 @@ ## Example

[Check it out on JSFiddle](https://jsfiddle.net/b20jk7po/)
[Check it out on JSFiddle](https://jsfiddle.net/craig_h_411/6Lmb1h9s/)

@@ -48,0 +48,0 @@

Vue.directive('model-on', {
bind: function(el, binding, vnode) {
el.addEventListener(binding.arg, function() {
vnode.context[binding.expression] = el.value;
});
}
});
bind: function(el, binding, vnode) {
el.value = vnode.context[binding.expression];
el.addEventListener(binding.arg, function() {
vnode.context[binding.expression] = el.value;
});
},
update: function(el, binding, vnode) {
el.value = vnode.context[binding.expression];
}
});
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