{"id":16773910,"url":"https://github.com/wayou/num-input","last_synced_at":"2025-03-16T17:21:57.015Z","repository":{"id":61841620,"uuid":"555653794","full_name":"wayou/num-input","owner":"wayou","description":"微信小程序自定义组件带加减的数字输入框","archived":false,"fork":false,"pushed_at":"2022-12-12T13:27:39.000Z","size":21,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T07:05:19.655Z","etag":null,"topics":["component","mini-program","number-input"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/wayou.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":"2022-10-22T02:36:00.000Z","updated_at":"2023-03-08T04:18:29.000Z","dependencies_parsed_at":"2023-01-27T19:55:11.467Z","dependency_job_id":null,"html_url":"https://github.com/wayou/num-input","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayou%2Fnum-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayou%2Fnum-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayou%2Fnum-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayou%2Fnum-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wayou","download_url":"https://codeload.github.com/wayou/num-input/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243903175,"owners_count":20366437,"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":["component","mini-program","number-input"],"created_at":"2024-10-13T06:47:23.281Z","updated_at":"2025-03-16T17:21:56.961Z","avatar_url":"https://github.com/wayou.png","language":"TypeScript","readme":"# num-input\n\n微信小程序自定义组件带加减的数字输入框。\n\n## 预览\n\n![preview](https://github.com/wayou/num-input/raw/master/preview.png)\n\n## 使用\n\n1. 安装\n\n```sh\n$ yarn add num-input\n```\n\n2. 点击开发者工具中的菜单栏：工具 --\u003e 构建 npm\n3. 在需要使用的页面配置文件中添加引用\n\n```json\n{\n  \"usingComponents\": {\n    \"num-input\": \"num-input\"\n  }\n}\n```\n\n更多关于小程序中使用 npm 包的信息参见官方文档 [npm 支持](https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html)。\n\n## 示例：\n\n_page.json_\n\n```json\n{\n  \"usingComponents\": {\n    \"num-input\": \"num-input\"\n  }\n}\n```\n\n_page.wxml_\n\n```html\n\u003cnum-input bindinput=\"onInput\" value=\"{{ num }}\" size=\"m\" /\u003e\n```\n\n_page.js_\n\n```js\nPage({\n  data:{\n    num: 1,\n  }\n  onInput(event) {\n    this.setData({\n      num: event.detail.value\n    })\n  },\n});\n```\n\n## 配置项\n\n| 属性                 | 默认值 | 描述                               |\n| -------------------- | ------ | ---------------------------------- |\n| `value`              | -      | 输入框的值                         |\n| `disabled`           | -      | 是否禁用                           |\n| `step`               | 1      | 加减点击后的步长                   |\n| `ext-class-input`    | -      | 自定义输入框类名                   |\n| `ext-class-increase` | -      | 自定义加号按钮框类名               |\n| `ext-class-decrease` | -      | 自定义减号按钮类名                 |\n| `size`               | `m`    | 尺寸，可选值 `s`\u0026#124;`m`\u0026#124;`l` |\n\n## 事件\n\n| 事件名  | 描述             |\n| ------- | ---------------- |\n| `input` | 输入框的发生变化 |\n\n## 相关资源\n\n- [小程序自定义组件文档](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/)\n- [weui 文档](https://wechat-miniprogram.github.io/weui/docs/)\n- [组件样式](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#%E7%BB%84%E4%BB%B6%E6%A0%B7%E5%BC%8F)\n- [npm 支持](https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayou%2Fnum-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwayou%2Fnum-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayou%2Fnum-input/lists"}