{"id":24419121,"url":"https://github.com/electroluxcode/webzen-ui","last_synced_at":"2025-04-12T06:05:13.780Z","repository":{"id":162461033,"uuid":"636999553","full_name":"electroluxcode/webzen-ui","owner":"electroluxcode","description":"兴趣使然的 原生webcomponent 组件库","archived":false,"fork":false,"pushed_at":"2023-12-18T06:41:26.000Z","size":3352,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-12T06:04:57.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://electroluxcode.github.io/webzen-ui/","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/electroluxcode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-05-06T07:40:38.000Z","updated_at":"2025-03-20T17:03:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2a3edf6-83d5-41f6-ac0e-e4c5d9a4c8ed","html_url":"https://github.com/electroluxcode/webzen-ui","commit_stats":null,"previous_names":["electroluxcode/webzen-ui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electroluxcode%2Fwebzen-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electroluxcode%2Fwebzen-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electroluxcode%2Fwebzen-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electroluxcode%2Fwebzen-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/electroluxcode","download_url":"https://codeload.github.com/electroluxcode/webzen-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525143,"owners_count":21118618,"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":"2025-01-20T09:19:01.770Z","updated_at":"2025-04-12T06:05:13.740Z","avatar_url":"https://github.com/electroluxcode.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\u003ch1\u003e\n\u003cbr/\u003e\n📋\n\u003cbr /\u003e\nWebzen-ui\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003c/h1\u003e\n\u003csup\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ca href=\"https://gitee.com/Electrolux/\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=version\u0026message=v0.0.1\u0026color=blue\" alt=\"npm package\" /\u003e\u003c/a\u003e\u003ca href=https://space.bilibili.com/286773126\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=Bili\u0026message=Electrolux\u0026color=red\" alt=\"temp\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://gitee.com/Electrolux/\"\u003e   \u003cimg src=\"https://img.shields.io/static/v1?label=Author\u0026message=electrolux\u0026color=yellow\" alt=\"demos\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://gitee.com/Electrolux/\"\u003e   \u003cimg src=\"https://img.shields.io/static/v1?label=Contribute\u0026message=welcome\u0026color=green\" alt=\"demos\" /\u003e\u003c/a\u003e\n\u003cbr /\u003e\n\u003c/a\u003e\n\u003cbr /\u003e\nTranslations: \u003ca href=\"\"\u003e🇨🇳 汉语\u003c/a\u003e\n\u003c/sup\u003e\n\u003c/div\u003e\n\n\n\n由web-component构成的 前端框架\n\n\n\n\n\n## Quick start\n\n```shell\nnpm install webzen-ui \n```\n\n\n\n\n\n\n## Features\n\n- table\n- card\n- button\n- layout\n\n\n\n\n\n\n## Developer\n\n\n\n- step1：根目录的src/components 文件中。新建你的组件文件夹,用icon做一个示例\n\n结构如下\n-wz-icon\n--index.ts\n--index.less\n--index.html\n--assets\n\n\n- step2：如果你的组件编写完 运行 sh build.sh 进行 编译 .这个脚本会对 ts和 less进行编译(暂时不做这一块)\n\n\n```shell\n# 由于web component 的 一系列 不可控因素。因此 我们每一个 组件都必须 经过以下个流程\n\n\n# step3：最终传入 core/.ts 进行引用\n注意区分按需引入(import xx.js )\n全量引入 (全部引入)\n\n# step???：你的测试用例应该包括\n-- 1.判断shadow dom 存不存在\n-- 2.判断属性是否能够设置成功，判断属性设置之后能不能渲染出指定的dom数\n-- 3.判断是否能够在50ms 渲染不大的数据\n-- 4.判断工具方法是否能够生效\n\n\n\n\n```\n\n\n\n\n\n\n\n## Docs\n\n```shell\n# 全局安装 docsify-cli 工具\nnpm i docsify-cli -g\n# 初始化项目\ndocsify init ./docs\n# docs  的 意思 就是在 docs 中 新开一个 端口\ndocsify serve docs\n\n\n# _navbar.md 文件可以修改侧边栏\n\n\n\n\n```\n\n\n\n\n\n\n\n\n## Todo\n\n\n\n```\ncaiIpt.addEventListener('change', function(e) {\n    console.log(e); // e.detail 为表单的值\n  }) \n```\n\n\n​          \n\n​      \n\n\n\n\n\n\n\n\n\n\n\n\n\n## Knowledge\n\n\n\n### 1. webcomponent | 深浅色模式\n\n一般我们说的深色浅色模式，有以下几种方案\n\n- 例如vitepress 他是在头部添加class为night的变量,然后通过优先级控制的方法进行控制\n- 例如antd 他是在 body 添加一个属性是data-theme 的字段\n- 利用浏览器自身的方案：例如是prefer-color-theme 或者\n\n我这里沿用 vitepress的 方案，但是区别是在头部加会因为shadow dom 的原因，而不能进行穿透。\n\n我采用的方案如下\n\n- 利用 发布者/订阅者模式，在我的基类元素初始化的时候给基类的头部添加元素就可以了，并且引入 dark/light的 样式文件\n\n遇到的问题是 webcomponent是 异步的 ，因此需要引入声明周期的概念,\n\n\n\n\n\n\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectroluxcode%2Fwebzen-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felectroluxcode%2Fwebzen-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectroluxcode%2Fwebzen-ui/lists"}