{"id":20226140,"url":"https://github.com/steamerjs/react-touch-component","last_synced_at":"2025-04-10T17:06:20.965Z","repository":{"id":57346607,"uuid":"75472955","full_name":"steamerjs/react-touch-component","owner":"steamerjs","description":"react mobile touch component","archived":false,"fork":false,"pushed_at":"2017-12-27T07:18:32.000Z","size":120,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T04:35:42.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steamerjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-03T12:41:52.000Z","updated_at":"2018-04-20T03:22:45.000Z","dependencies_parsed_at":"2022-09-11T16:33:16.498Z","dependency_job_id":null,"html_url":"https://github.com/steamerjs/react-touch-component","commit_stats":null,"previous_names":["steamerteam/react-touch-component"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Freact-touch-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Freact-touch-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Freact-touch-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Freact-touch-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steamerjs","download_url":"https://codeload.github.com/steamerjs/react-touch-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248260458,"owners_count":21074210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-11-14T07:16:27.639Z","updated_at":"2025-04-10T17:06:20.941Z","avatar_url":"https://github.com/steamerjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"react-touch-component\n==========\n\n[![NPM Version](https://img.shields.io/npm/v/react-touch-component.svg?style=flat)](https://www.npmjs.com/package/react-touch-component)\n\n借鉴zepto touch封装的React Component\n\nonTap事件兼容PC使用\n\nBase on zepto touch lib.\n\nonTap event also works with PC as well.\n\n\nSupported Events\n----------\n\n- onTap\n- onSingleTap\n- onDoubleTap\n- onLongTap\n- onSwipe\n- onSwipeUp\n- onSwipeRight\n- onSwipeDown\n- onSwipeLeft\n\n\nInstallation\n----------\n\n```\n$ npm install react-touch-component --save\n```\n\n\nUsage\n----------\nReact 版本\n\n```js\nimport Touch from 'react-touch-component';\n\nexport default class Demo extends Component {\n  constructor(props, context) {\n    super(props, context);\n    this.state = {};\n    this.handleTap = this.handleTap.bind(this);\n  }\n  \n  handleTap() {\n    console.log('tap!');\n  }\n  \n  render() {\n    \u003cTouch onTap={this.handleTap}\u003e\n      \u003cbutton\u003eTap me\u003c/button\u003e\n    \u003c/Touch\u003e\n  }\n}\n```\n\nPreact版本\n```js\nimport Touch from 'react-touch-component/lib/pindex';\n\n```\n\n\nChangelog\n----------\n\n- `v1.1.4` (2017/12/27) 完善Node环境兼容\n- `v1.1.3` (2017/11/11) 完善Node环境兼容\n- `v1.1.1` (2017/6/12) 兼容React v15.5后的版本\n- `v1.1.0` (2017/2/28) 新增preact版本\n- `v1.0.1` (2017/2/22) 兼容Node环境，防止脚本报错\n- `v1.0.0` (2017/2/8) 初版","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Freact-touch-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteamerjs%2Freact-touch-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Freact-touch-component/lists"}