{"id":13655145,"url":"https://github.com/cqkqinfo/ui","last_synced_at":"2025-04-23T10:31:56.328Z","repository":{"id":40602832,"uuid":"407783248","full_name":"cqkqinfo/ui","owner":"cqkqinfo","description":"基于 Remax 全平台 UI 库","archived":false,"fork":false,"pushed_at":"2022-09-16T05:20:03.000Z","size":40452,"stargazers_count":75,"open_issues_count":16,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T06:19:10.028Z","etag":null,"topics":["alipay-mini-program","react","react-native","remax","typescript","ui-components","wechat-mini-program"],"latest_commit_sha":null,"homepage":"https://cqkqinfo.github.io/ui/","language":"TypeScript","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/cqkqinfo.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":"2021-09-18T07:00:21.000Z","updated_at":"2025-03-24T13:57:06.000Z","dependencies_parsed_at":"2022-07-13T17:20:39.439Z","dependency_job_id":null,"html_url":"https://github.com/cqkqinfo/ui","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cqkqinfo%2Fui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cqkqinfo%2Fui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cqkqinfo%2Fui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cqkqinfo%2Fui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cqkqinfo","download_url":"https://codeload.github.com/cqkqinfo/ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250379787,"owners_count":21420841,"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":["alipay-mini-program","react","react-native","remax","typescript","ui-components","wechat-mini-program"],"created_at":"2024-08-02T03:00:58.616Z","updated_at":"2025-04-23T10:31:51.297Z","avatar_url":"https://github.com/cqkqinfo.png","language":"TypeScript","funding_links":[],"categories":["目录"],"sub_categories":["组件"],"readme":"# 凯桥 UI\n\n[![NPM version][npm-image]][npm-url] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/@kqinfo/ui.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/@kqinfo/ui\n[codecov-image]: https://codecov.io/gh/cqkqinfo/ui/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/cqkqinfo/ui\n[download-image]: https://img.shields.io/npm/dm/@kqinfo/ui.svg?style=flat-square\n[download-url]: https://www.npmjs.com/package/@kqinfo/ui\n\n## 使用\n\n```bash\n$ yarn add @kqinfo/ui\n```\n\n## 按需加载\n\n安装`babel-plugin-import`插件\n\n```bash\n$ yarn add babel-plugin-import -D\n```\n\n修改`babel.config.js`文件\n\n```diff\n// babel.config.js\nmodule.exports = {\n  plugins: [\n+    [\n+      'import',\n+      {\n+        libraryDirectory: 'es',\n+        libraryName: '@kqinfo/ui'\n+      },\n+      '@kqinfo/ui'\n+    ]\n  ]\n};\n\n```\n\n## 定制主题\n\n修改`remax.config.js`文件\n\n```diff\nmodule.exports = {\n  ...\n-  plugins: [less()],\n+  plugins: [\n+   less({\n+     lessOptions: {\n+       modifyVars: { '@brand-primary': '#2780d9', '@brand-attract': '#ff9d46' },\n+       javascriptEnabled: true\n+     }\n+   })\n+ ]\n  ...\n};\n```\n\n修改`app.tsx`文件\n\n```diff\n+import { ConfigProvider } from '@kqinfo/ui';\n\nconst App = (props) =\u003e {\n-  return props.children;\n+  return \u003cConfigProvider brandAttract={'#ff9d46'} brandPrimary={'#2780d9'}\u003e{props.children}\u003c/ConfigProvider\u003e;\n};\n```\n\n## 使用源安装\n\n在项目根目录添加`.npmrc`文件\n\n```\ncanvas_binary_host_mirror=https://npm.taobao.org/mirrors/canvas/\nsass_binary_site=https://npm.taobao.org/mirrors/node-sass/\nphantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/\nelectron_mirror=https://npm.taobao.org/mirrors/electron/\nchromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver/\nsentrycli_cdnurl=https://cdn.npm.taobao.org/dist/sentry-cli\ncypress_download_mirror=https://npm.taobao.org/mirrors/cypress/\n```\n\n用`yarn`安装的话添加`.yarnrc`文件\n\n```\ncanvas_binary_host_mirror: https://npm.taobao.org/mirrors/canvas\nregistry: https://registry.npm.taobao.org\nENTRYCLI_CDNURL: https://cdn.npm.taobao.org/dist/sentry-cli\nsentrycli_cdnurl: https://cdn.npm.taobao.org/dist/sentry-cli\n```\n\n## 开发\n\n安装依赖\n\n```bash\n$ yarn\n```\n\n启动服务\n\n```bash\n$ yarn start\n```\n\n## 本地调试\n\n启动调试\n\n```bash\n$ yarn dev\n```\n\n本地连接\n\n```bash\n$ yarn link\n```\n\n本地项目调试\n\n```bash\n$ yarn link @kqinfo/ui\n```\n\n## 编写测试\n\n- 相关库 [jest](https://jestjs.io/zh-Hans/docs/getting-started) 、[testing-library](https://testing-library.com/docs/react-testing-library/intro)\n- [如何编写测试](https://segmentfault.com/a/1190000022054307)\n\n## 开发注意项\n\n- 先`fork`到自己名下，再提`merge request`\n- 样式不要嵌套\n- 样式用`less-modules`\n- 表单组件暴露`value`和`onChange`\n- 不要用图片当`icon`\n- 尽量暴露节点的`class`，缩写用`cls`，比如暴露子项类名就用`itemCls`\n- 例子尽量写多点\n\n## 钉钉交流群\n\n\u003cimg width=\"320\" src=\"https://kq-static.oss-cn-beijing.aliyuncs.com/common-img/IMG_8025.JPG\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcqkqinfo%2Fui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcqkqinfo%2Fui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcqkqinfo%2Fui/lists"}