{"id":13424249,"url":"https://github.com/mlyknown/vue-gesture","last_synced_at":"2026-01-15T02:51:49.511Z","repository":{"id":40763190,"uuid":"54968452","full_name":"mlyknown/vue-gesture","owner":"mlyknown","description":"touch events plugin for Vue.js.You can v-gesture directive,and directive auguments can use a tap, swipe, etc","archived":false,"fork":false,"pushed_at":"2018-06-14T07:22:06.000Z","size":35,"stargazers_count":146,"open_issues_count":0,"forks_count":39,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-01-12T04:25:05.702Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlyknown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-29T10:53:34.000Z","updated_at":"2024-09-16T09:17:01.000Z","dependencies_parsed_at":"2022-07-29T12:49:18.217Z","dependency_job_id":null,"html_url":"https://github.com/mlyknown/vue-gesture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mlyknown/vue-gesture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlyknown%2Fvue-gesture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlyknown%2Fvue-gesture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlyknown%2Fvue-gesture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlyknown%2Fvue-gesture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlyknown","download_url":"https://codeload.github.com/mlyknown/vue-gesture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlyknown%2Fvue-gesture/sbom","scorecard":{"id":653698,"data":{"date":"2025-08-11","repo":{"name":"github.com/mlyknown/vue-gesture","commit":"d4a34f381e35129ca574a537c256c933f81aa8ba"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 2/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T14:09:32.728Z","repository_id":40763190,"created_at":"2025-08-21T14:09:32.729Z","updated_at":"2025-08-21T14:09:32.729Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28441621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T00:00:50.744Z","updated_at":"2026-01-15T02:51:49.493Z","avatar_url":"https://github.com/mlyknown.png","language":"JavaScript","funding_links":[],"categories":["Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","实用库","Awesome Vue.js"],"sub_categories":["Libraries \u0026 Plugins"],"readme":"# vue-gesture\n\n\u003e **Vue-Gesture** is a simple Vue.js gesture events plugin.\n \u003eIt runs now under Vue.js 2, which comes from a fork, to see here: https://github.com/bees4ever/vue2-gesture. The old version for Vue.js 1 is not longer available.\n See the example for how to use this plugin, simply it's now a component and not a directive anymore.\n There are a bunches of arguments you can use, i.e. tap, swipe, touchstart etc. \n When you are in the use of the PC，\"tap, longtap, touchstart\" will automatically be converted to \"click\".\n\n- tap — fires when the element is tapped.\n- doubleTap — this pair of events can be used to detect double taps on the same element\n- longTap — fires when an element is tapped and the finger is held down for more than 750ms.\n- swipe, swipeLeft, swipeRight, swipeUp, swipeDown — fires when an element is swiped \n- touchstart touchmove touchend click- These equivalent to touch the primary event \n\n\n## Install\n\n#### CommonJS\n\nThe updated version is available through npm as `vue2-gesture`. So simply run `npm install vue2-gesture`. Then you can use it as follows:\n\n  ``` js\n  // You may use: \n    window.Vue = Vue;\n  var VueGesture = require('vue2-gesture')\n  Vue.use(VueGesture)\n  ```\n\n#### Direct include\n\nYou can also directly include it with a `\u003cscript\u003e` tag when you have Vue already included globally. It will automatically install itself, and will add a global `vueGesture`.\n\n## Usage\n\n#### Using the `vue-gesture` component\n***WARNING: You may have to use `\u003cvue2-gesture\u003e` if you installed the npm version***\n\nYou can add a single event with the `type` parameter or you add a set of events with the `types` parameter which is\na javascript array.\n\n``` html\n \u003cvue-gesture :type=\"'touchstart'\"  :call=\"handleComponent.bind(this,'touchstart')\" \u003etouchstart\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'touchmove'\"  :call=\"handleComponent.bind(this,'touchmove')\" \u003e\u003ci\u003etouchmove\u003c/i\u003e\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'touchend'\"  :call=\"handleComponent.bind(this,'touchend')\" \u003etouchend\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'doubletap'\"  :call=\"handleComponent.bind(this,'doubletap')\"\u003edoubleTap\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'tap'\"  :call=\"handleComponent.bind(this,'tap')\"\u003etap\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'longTap'\"  :call=\"handleComponent.bind(this,'longTap')\"\u003elongTap\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'swipe'\"  :call=\"handleComponent.bind(this,'swipe')\"\u003eswipe\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'swipeLeft'\"  :call=\"handleComponent.bind(this,'swipeLeft')\"\u003eswipeLeft\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'swipeRight'\"  :call=\"handleComponent.bind(this,'swipeRight')\"\u003eswipeRight\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'swipeUp'\"  :call=\"handleComponent.bind(this,'swipeUp')\"\u003eswipeUp\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'swipeDown'\"  :call=\"handleComponent.bind(this,'swipeDown')\"\u003eswipeDown\u003c/vue-gesture\u003e\n  \u003cvue-gesture :type=\"'click'\"  :call=\"handleComponent.bind(this,'click')\"\u003eclick\u003c/vue-gesture\u003e\n  \u003cvue-gesture :types=\"['swipeDown','click']\"   :call=\"handleComponent.bind(this,'EVENT')\" \u003eswipeDown and click\u003c/vue-gesture\u003e\n\n```\n\nWhere `handleComponent` is a method in your Vue.js web-application. `handleComponent` should understand this two parameters:\n\n  ``` js\n handleComponent: function(str,e){\n             // str is the second input, like 'longTap', 'touchmove', \n             // there you can pass some information to the handler \n             // e is the element itself, you may use it or not\n             var html = e.srcElement.innerHTML;\n             e.srcElement.innerHTML=html+\" \"+str;\n             console.log(str);\n         }\n  ```\n  \n#### EDIT:\n\nA simpler way to handle vue-gesture events have been provided by @sjoerdloeve and uses this syntax:\n\n```\n\u003cvue-gesture :type=\"'tap'\" :call=\"() =\u003e { changeProperty = true}\" \u003etap\u003c/vue-gesture\u003e\n```\n_Where the type, of course, is changeable._\n\n\n#### Configuring Recognizer Options\n\nThere are two ways to customize recognizer options such as `direction` and `threshold`. The first one is setting global options:\n\n``` js\n// change the config\nvueGesture.config = {\n  maxSingleTapTimeInterval: 200\n}\n```\n#### Registering Custom Events\n\nSee `/example` for a multi-event demo. To build it, run `npm install \u0026\u0026 npm run build`.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlyknown%2Fvue-gesture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlyknown%2Fvue-gesture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlyknown%2Fvue-gesture/lists"}