{"id":14976553,"url":"https://github.com/xwpongithub/better-keyboard","last_synced_at":"2025-10-27T20:32:09.468Z","repository":{"id":143855826,"uuid":"88243465","full_name":"xwpongithub/better-keyboard","owner":"xwpongithub","description":"A js keyboard component for mobile.","archived":false,"fork":false,"pushed_at":"2021-01-12T05:47:59.000Z","size":2937,"stargazers_count":55,"open_issues_count":0,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-01T08:11:12.846Z","etag":null,"topics":["es6","javascript","keyboard","webpack2"],"latest_commit_sha":null,"homepage":null,"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/xwpongithub.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-14T07:17:53.000Z","updated_at":"2022-10-17T20:53:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"d814a491-66f8-448f-a633-3b90fb3b6700","html_url":"https://github.com/xwpongithub/better-keyboard","commit_stats":{"total_commits":24,"total_committers":4,"mean_commits":6.0,"dds":"0.20833333333333337","last_synced_commit":"762158136a430b0aee98c74684e787c216f408d1"},"previous_names":["xwpongithub/jkeyboard"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwpongithub%2Fbetter-keyboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwpongithub%2Fbetter-keyboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwpongithub%2Fbetter-keyboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwpongithub%2Fbetter-keyboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xwpongithub","download_url":"https://codeload.github.com/xwpongithub/better-keyboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238553305,"owners_count":19491405,"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":["es6","javascript","keyboard","webpack2"],"created_at":"2024-09-24T13:54:03.708Z","updated_at":"2025-10-27T20:32:08.783Z","avatar_url":"https://github.com/xwpongithub.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# better-keyboard\nA js keyboard component for mobile.\n\n![better-keyboard preview](./demo.gif)  \n\n## 立即使用\n\n```HTML\n\u003cbody\u003e\n  \u003cscript type=\"text/javascript\" src=\"jkeyboard.js\"\u003e\u003c/script\u003e\n  \u003cscript type=\"text/javascript\"\u003e\n    var keyboard = new JKeyboard({\n      onInput: function (key, rs) {\n          // do something\n      },\n      onClose: function () {\n         // do something\n      },\n      onShow: function () {\n         // do something \n      },\n      onDelete: function (rs) {\n         // do something\n      }\n    });                             \n  \u003c/script\u003e\n\u003c/body\u003e\n```  \n\n## 通过npm引入\n\n安装better-keyboard\n\n```shell\nnpm install better-keyboard --save-dev\n```\n引入better-keyboard\n\n```javascript\nimport JKeyboard from 'better-keyboard'\n````\n\n测试demo页\n\n```shell\nnpm run dev\n```\n\n打开浏览器访问如下地址, 查看效果\n\n\u003e localhost:9090  \n\n## Options 参数  \n\n-  defaultResult: `[]` 默认值\n-  containEl:  `body` 父级容器\n-  closeTitle: `完成` 关闭按钮文本\n-  max:  `6` 最大长度\n\n## Events 事件\n\n-  onInput  点击数字按钮\n-  onClose  键盘关闭\n-  onClosed 关闭动画结束后 \n-  onShow  键盘打开\n-  onDelete 点击删除按钮  \n\n## 实例方法\n\n-  show  打开键盘\n-  close  关闭键盘\n-  empty 清空输入值\n-  setResult  设置输入值\n-  getResult 获取当前输入值\n-  closeAndClear 关闭并清空已输入的值","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwpongithub%2Fbetter-keyboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxwpongithub%2Fbetter-keyboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwpongithub%2Fbetter-keyboard/lists"}