{"id":18784820,"url":"https://github.com/zy445566/web-components-content","last_synced_at":"2026-05-01T06:33:47.394Z","repository":{"id":87742020,"uuid":"290699131","full_name":"zy445566/web-components-content","owner":"zy445566","description":"WebComponents base components ","archived":false,"fork":false,"pushed_at":"2021-01-18T08:50:17.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T02:28:19.991Z","etag":null,"topics":["base","components","web","webcomponents"],"latest_commit_sha":null,"homepage":"","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/zy445566.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-27T06:49:17.000Z","updated_at":"2021-01-18T08:50:20.000Z","dependencies_parsed_at":"2023-06-14T21:16:05.308Z","dependency_job_id":null,"html_url":"https://github.com/zy445566/web-components-content","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"8471f5241fac2347cb36ecd3ba081b70fb4b1234"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zy445566/web-components-content","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zy445566%2Fweb-components-content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zy445566%2Fweb-components-content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zy445566%2Fweb-components-content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zy445566%2Fweb-components-content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zy445566","download_url":"https://codeload.github.com/zy445566/web-components-content/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zy445566%2Fweb-components-content/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32487532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["base","components","web","webcomponents"],"created_at":"2024-11-07T20:44:08.253Z","updated_at":"2026-05-01T06:33:47.371Z","avatar_url":"https://github.com/zy445566.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# web-components-content\r\nWebComponents base components \r\n\r\n# install\r\n```sh\r\nnpm install web-components-content\r\n```\r\n\r\n# use\r\n### HTMLContent\r\n```js\r\nimport indexHtml from './index.html'\r\nimport {HTMLContent} from 'web-components-content'\r\nexport default class MyHome extends HTMLContent {\r\n    constructor() {\r\n        super();\r\n        this.render(indexHtml,{name:'Tom'});\r\n        this.addStyleSheets(document.styleSheets);\r\n        this.init();\r\n    }\r\n}\r\n```\r\nOR\r\n```js\r\nconst indexHtml ='\u003ch1\u003e${name}\u003c/h1\u003e';\r\nimport {HTMLContent} from 'web-components-content'\r\nexport default class MyHome extends HTMLContent {\r\n    constructor() {\r\n        super();\r\n        this.render(indexHtml,{name:'Tom'});\r\n        this.addStyleSheets(document.styleSheets);\r\n        this.init();\r\n    }\r\n}\r\n```\r\n### MyHashRoute\r\n```html\r\n\u003c!-- app.html --\u003e\r\n\u003cmy-router\u003e\r\n    \u003cmy-hash-route path=\"\" tag=\"my-home\"\u003e\u003c/my-hash-route\u003e\r\n    \u003cmy-hash-route path=\"#my-monitor\" tag=\"my-monitor\"\u003e\u003c/my-hash-route\u003e\r\n\u003c/my-router\u003e\r\n```\r\n```js\r\nimport appHtml from './app.html'\r\nimport {HTMLContent,MyHashRoute,MyRouter} from 'web-components-content'\r\nimport MyHome from '@/pages/MyHome/index.js'\r\nimport myMonitor from '@/pages/myMonitor/index.js'\r\nclass AppContainer extends HTMLContent {\r\n    constructor() {\r\n        super();\r\n        this.render(appHtml)\r\n        this.addStyleSheets(document.styleSheets)\r\n    }\r\n}\r\nwindow.customElements.define('app-container', AppContainer);\r\nwindow.customElements.define('my-home', MyHome);\r\nwindow.customElements.define('my-monitor', myMonitor);\r\nwindow.customElements.define('my-router', MyRouter);\r\nwindow.customElements.define('my-hash-route', MyHashRoute);\r\n```\r\n\r\n### MyBrowseRoute\r\n```html\r\n\u003c!-- app.html --\u003e\r\n\u003cmy-router\u003e\r\n    \u003cmy-browse-route path=\"/\" tag=\"my-home\"\u003e\u003c/my-browse-route\u003e\r\n    \u003cmy-browse-route path=\"/my-monitor\" tag=\"my-monitor\"\u003e\u003c/my-browse-route\u003e\r\n\u003c/my-router\u003e\r\n```\r\n```js\r\nimport appHtml from './app.html'\r\nimport {HTMLContent,MyBrowseRoute,MyRouter} from 'web-components-content'\r\nimport MyHome from '@/pages/MyHome/index.js'\r\nimport myMonitor from '@/pages/myMonitor/index.js'\r\nclass AppContainer extends HTMLContent {\r\n    constructor() {\r\n        super();\r\n        this.render(appHtml)\r\n        this.addStyleSheets(document.styleSheets)\r\n    }\r\n}\r\nwindow.customElements.define('app-container', AppContainer);\r\nwindow.customElements.define('my-home', MyHome);\r\nwindow.customElements.define('my-monitor', myMonitor);\r\nwindow.customElements.define('my-router', MyRouter);\r\nwindow.customElements.define('my-browse-route', MyBrowseRoute);\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzy445566%2Fweb-components-content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzy445566%2Fweb-components-content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzy445566%2Fweb-components-content/lists"}