{"id":15566909,"url":"https://github.com/weilkss/react-vue-loading","last_synced_at":"2026-04-29T21:02:59.011Z","repository":{"id":57347500,"uuid":"171207150","full_name":"weilkss/react-vue-loading","owner":"weilkss","description":"适用于vue、react的loading谷歌加载组件,Loading Google load component for Vue and react","archived":false,"fork":false,"pushed_at":"2020-07-15T03:40:00.000Z","size":33,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-08T09:08:02.351Z","etag":null,"topics":["loading","reactjs","shelljs","vuejs"],"latest_commit_sha":null,"homepage":"https://www.weilkss.cn/react-vue-loading","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weilkss.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":"2019-02-18T03:18:22.000Z","updated_at":"2020-07-15T03:40:03.000Z","dependencies_parsed_at":"2022-09-26T17:11:16.095Z","dependency_job_id":null,"html_url":"https://github.com/weilkss/react-vue-loading","commit_stats":null,"previous_names":["xwb007/xwb-loading"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/weilkss/react-vue-loading","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weilkss%2Freact-vue-loading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weilkss%2Freact-vue-loading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weilkss%2Freact-vue-loading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weilkss%2Freact-vue-loading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weilkss","download_url":"https://codeload.github.com/weilkss/react-vue-loading/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weilkss%2Freact-vue-loading/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265872199,"owners_count":23842142,"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":["loading","reactjs","shelljs","vuejs"],"created_at":"2024-10-02T17:08:30.400Z","updated_at":"2026-04-29T21:02:59.004Z","avatar_url":"https://github.com/weilkss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003ccenter\u003e🚀 react-vue-loading\u003c/center\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-vue-loading\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/react-vue-loading.svg\" alt=\"npm version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-vue-loading\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/react-vue-loading.svg\" alt=\"npm downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/package/react-vue-loading\"\u003e\u003cimg src=\"https://img.shields.io/bundlephobia/minzip/react-vue-loading\" alt=\"bundle size\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/npm/l/react-vue-loading.svg\" alt=\"license\"\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003eA Zero-Dependency, Cross-Framework Loading Component.\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.weilkss.cn/react-vue-loading\"\u003e👉 Live Demo \u0026 Homepage 👈\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## ✨ 特性 (Features)\n\n- **真正零依赖 (Zero-Dependency)**：底层基于原生 Web Components 实现，不依赖任何框架的 Runtime。\n- **跨框架通用**：完美支持 `React`, `Vue 2/3`, `Svelte`, `SolidJS`, 甚至**原生纯 HTML**。\n- **极致轻量**：打包体积仅 **~1KB**，且完全没有内存泄漏。\n- **完美的 TypeScript 支持**：开箱即用，在 React 和 Vue 中都有极佳的 Props 代码提示。\n\n## 📦 安装 (Install)\n\n```shell\nnpm install react-vue-loading\n# or\nyarn add react-vue-loading\n# or\npnpm add react-vue-loading\n```\n\n## 🔧 引入 (Import)\n\n```js\n\u003cscript\n  type=\"module\"\n  src=\"https://unpkg.com/react-vue-loading@1.0.6/lib/react-vue-loading.js\"\n\u003e\u003c/script\u003e\n```\n\n## 💻 使用指南 (Usage)\n\n由于底层架构的升级，你**不再需要**像以前那样配置 `Vue.use()`，直接引入即可使用！\n\n### ⚛️ 在 React 中使用\n\n```tsx\nimport React from \"react\";\nimport RVLoading from \"react-vue-loading\";\n\nexport default function App() {\n  return (\n    \u003cdiv className=\"example\"\u003e\n      \u003ch3\u003eReact Example\u003c/h3\u003e\n      \u003cRVLoading size={32} color=\"#2396fa\" /\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n### 💚 在 Vue 3 / Vue 2 中使用\n\n```vue\n\u003ctemplate\u003e\n  \u003cdiv class=\"example\"\u003e\n    \u003ch3\u003eVue Example\u003c/h3\u003e\n    \u003cRVLoading :size=\"32\" color=\"#2396fa\" /\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript lang=\"ts\" setup\u003e\nimport RVLoading from \"react-vue-loading\";\n\u003c/\u003e\n```\n\n\u003e **💡 Vue 用户小贴士**: 如果在控制台看到 `Failed to resolve component...` 警告，这是因为 Vue 试图解析原生 Web Component。你可以在 `vite.config.ts` 或 `vue.config.js` 中配置 `compilerOptions.isCustomElement = tag =\u003e tag === 'rv-loading'` 即可消除警告。\n\n### 🌐 在纯 HTML / 原生 JS 中使用\n\n不仅是框架，在没有任何构建工具的原生网页中也能跑！\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003c!-- 引入组件库即可自动注册 --\u003e\n    \u003cscript type=\"module\"\u003e\n      import \"react-vue-loading\";\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- 当做原生 HTML 标签直接使用 --\u003e\n    \u003crv-loading size=\"40\" color=\"red\"\u003e\u003c/rv-loading\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## ⚙️ 属性 (Props)\n\n组件支持智能的 TypeScript 类型推导：\n\n| 属性 (Prop) | 默认值 (Default) | 数据类型 (Type)    | 说明 (Description)                        |\n| ----------- | ---------------- | ------------------ | ----------------------------------------- |\n| `size`      | `24`             | `number \\| string` | Loading的大小 (px)                        |\n| `color`     | `#2396fa`        | `string`           | Loading 线条的颜色，支持 hex/rgb/英文单词 |\n\n## 🛠 本地开发 (Development)\n\n```shell\n# 1. Clone 仓库\ngit clone https://github.com/weilkss/react-vue-loading.git\n\n# 2. 安装依赖\nnpm install\n\n# 3. 本地打包构建\nnpm run build\n```\n\n## 📄 License\n\n[ISC](LICENSE) © weilkss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweilkss%2Freact-vue-loading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweilkss%2Freact-vue-loading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweilkss%2Freact-vue-loading/lists"}