{"id":15046855,"url":"https://github.com/glean-wheat/wheat-ui","last_synced_at":"2025-10-28T07:31:10.197Z","repository":{"id":38108716,"uuid":"312916229","full_name":"glean-wheat/wheat-ui","owner":"glean-wheat","description":"Web Components 组件库；拍平框架差异","archived":false,"fork":false,"pushed_at":"2023-03-13T13:14:39.000Z","size":8839,"stargazers_count":26,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T12:44:13.325Z","etag":null,"topics":["lit-html","react","scss","storybook","vue","webcomponents"],"latest_commit_sha":null,"homepage":"https://glean-wheat.github.io/wheat-ui/storybook-static/","language":"SCSS","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/glean-wheat.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":"2020-11-14T22:50:31.000Z","updated_at":"2024-09-03T04:49:35.000Z","dependencies_parsed_at":"2023-02-17T14:00:37.630Z","dependency_job_id":null,"html_url":"https://github.com/glean-wheat/wheat-ui","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/glean-wheat%2Fwheat-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glean-wheat%2Fwheat-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glean-wheat%2Fwheat-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glean-wheat%2Fwheat-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glean-wheat","download_url":"https://codeload.github.com/glean-wheat/wheat-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238614403,"owners_count":19501451,"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":["lit-html","react","scss","storybook","vue","webcomponents"],"created_at":"2024-09-24T20:53:40.024Z","updated_at":"2025-10-28T07:31:08.947Z","avatar_url":"https://github.com/glean-wheat.png","language":"SCSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wheat-ui\n\n通过 web components 打造全新组件库\n\n## 适配所有框架\n\n无论你的技术栈使用的是 angular、vue、react；不存在框架兼容问题，你就当做标签直接使用\n\n## 示例\n![image](https://user-images.githubusercontent.com/24740506/121101469-7a400980-c82e-11eb-9b25-ba99cc5a4041.png)\n\n## 在 html 中使用\n\n### 将 dist 中的 wheat.ui.min.js 保存在本地或者 CDN 上，然后通过 script 引入即可\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"UTF-8\" /\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /\u003e\n    \u003cmeta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" /\u003e\n    \u003ctitle\u003eModal\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cstyle\u003e\u003c/style\u003e\n  \u003cbody\u003e\n    \u003cbutton onclick=\"showModal()\"\u003e显示弹框\u003c/button\u003e\n    \u003cwheat-modal title=\"弹窗\" visible=\"false\" maskCloseable=\"true\"\u003e\n      \u003cdiv slot=\"content\"\u003e\n        弹框内容\n      \u003c/div\u003e\n    \u003c/wheat-modal\u003e\n  \u003c/body\u003e\n  \u003cscript src=\"./dist/wheat.ui.min.js\"\u003e\u003c/script\u003e\n  \u003cscript\u003e\n    const MyModalDom = document.querySelector('wheat-modal')\n\n    MyModalDom.addEventListener('onCancel', (value) =\u003e {\n      const {\n        detail: { visible }\n      } = value\n      console.log('触发取消方法')\n      MyModalDom.setAttribute('visible', visible)\n    })\n\n    MyModalDom.addEventListener('onConfirm', (value) =\u003e {\n      console.log('触发确定方法')\n      MyModalDom.setAttribute('visible', false)\n    })\n    const showModal = () =\u003e {\n      MyModalDom.setAttribute('visible', true)\n    }\n  \u003c/script\u003e\n\u003c/html\u003e\n```\n\n## 在 angular、vue、react 项目中使用，\n\n### 安装\n\n```bash\nnpm i web-component-wheat-ui\n\n```\n\n## 使用\n\n```bash\nimport 'web-component-wheat-ui'\n\n```\n\n## 在 React 中使用\n\n```jsx\nimport React, { useState, useEffect } from 'react'\nimport 'web-component-wheat-ui'\nconst App = () =\u003e {\n  const [visible, setvisible] = useState(false)\n  useEffect(() =\u003e {\n    const MyModalDom = document.querySelector('wheat-modal')\n    MyModalDom.addEventListener('onCancel', (value) =\u003e {\n      const {\n        detail: { visible }\n      } = value\n      console.log('触发取消方法')\n      setvisible(visible)\n    })\n\n    MyModalDom.addEventListener('onConfirm', (value) =\u003e {\n      console.log('触发确定方法')\n      setvisible(false)\n    })\n  }, [])\n  return (\n    \u003cdiv className=\"App\"\u003e\n      \u003cbutton\n        onClick={() =\u003e {\n          setvisible(true)\n        }}\n      \u003e\n        显示弹框\n      \u003c/button\u003e\n      \u003cwheat-modal title=\"title\" visible={visible}\u003e\n        \u003cdiv slot=\"content\"\u003e弹框内容\u003c/div\u003e\n      \u003c/wheat-modal\u003e\n    \u003c/div\u003e\n  )\n}\n\nexport default App\n```\n\n## 在 Vue 中使用\n\n```vue\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cbutton @click=\"showModal\"\u003e\n      显示弹框\n    \u003c/button\u003e\n    \u003cwheat-modal title=\"title\" :visible=\"visible.toString()\"\u003e\n      \u003cdiv slot=\"content\"\u003e弹框内容\u003c/div\u003e\n    \u003c/wheat-modal\u003e\n    \u003cdiv\u003e{{ visible }}\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport 'web-component-wheat-ui'\n\nexport default {\n  data() {\n    return {\n      visible: false\n    }\n  },\n  mounted() {\n    const MyModalDom = document.querySelector('wheat-modal')\n    MyModalDom.addEventListener('onCancel', (value) =\u003e {\n      const {\n        detail: { visible }\n      } = value\n      console.log('触发取消方法', value)\n      this.visible = visible\n    })\n\n    MyModalDom.addEventListener('onConfirm', (value) =\u003e {\n      console.log('触发确定方法', value)\n      this.visible = false\n      this.hidden()\n    })\n  },\n  methods: {\n    showModal() {\n      this.visible = true\n    },\n    hidden() {\n      this.visible = false\n    }\n  }\n}\n\u003c/script\u003e\n```\n\n[更多\u003e\u003e](https://github.com/glean-wheat/wheat-ui/tree/master/src)\n\n## 贡献流程\n1.  添加 SSH \n2. clone 仓库\n\n```\nhttps://github.com/glean-wheat/wheat-ui\n```\n3. 新建 issue\n\n发现问题或者有开发者提出的问题了后，在`https://github.com/glean-wheat/wheat-ui/issues`创建issue;\n\n4. 在develop中拉取分支\n\n- 根据第三步创建的`issue`后，根据生成的`id`,创建分支，一般`bug`类的 命名为 `hotfix/#+ issueID`; 新增功能 `feature/#+issueID`\n\neg:\n\n```\nfeature/#3\n```\n\n5. 提交\n\n- 提交的时可根据 `commitlint` 规范进行提交；描述信息为该 `issue`的`id`;这样`github`会根据`id`进行关联\n\neg:\n\n```\ngit commit -m \"feat: #3\"\n```\n\n6: 提交PR\n\nmaster 是保护分支；需要有 review 之后；才可合并\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglean-wheat%2Fwheat-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglean-wheat%2Fwheat-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglean-wheat%2Fwheat-ui/lists"}