Skip to content

Commit

Permalink
Fix #74. Simplify the code and add README
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrybendy committed Aug 17, 2020
1 parent 3335bd5 commit 028a48c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ Same as `v-on:click.stop`, stops event propagation.

Same as `v-on:click.prevent`, prevents default event handler from firing.

#### disablePassive `(v2.3.0)`

`{passive: true}` is set for touch event listeners if your browser supports `passive`. This is good for user experience. If this is not what you want, you can use `disablePassive` modifier to prevent this behavior.

## Others

### How to add extra parameters
Expand Down
11 changes: 1 addition & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,8 @@ var vueTouchEvents = {
break;

case 'start':
var _m = binding.modifiers;
if (_m.disablePassive) {
// change the passive option for the moving event if disablePassive modifier exists
passiveOpt = false;
}
break;


case 'moving':
var _m = binding.modifiers;
if (_m.disablePassive) {
if (binding.modifiers.disablePassive) {
// change the passive option for the moving event if disablePassive modifier exists
passiveOpt = false;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue2-touch-events",
"version": "2.2.1",
"version": "2.3.0",
"description": "Simple touch events support for vueJS2",
"main": "index.js",
"types": "index.d.ts",
Expand Down

1 comment on commit 028a48c

@keaton-codes-tech
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is better! Glad to help.

Please sign in to comment.