{"id":13536093,"url":"https://github.com/Sopamo/vue-online","last_synced_at":"2025-04-02T02:32:13.167Z","repository":{"id":142305939,"uuid":"74564900","full_name":"Sopamo/vue-online","owner":"Sopamo","description":"A reactive offline indicator component for vue.js","archived":false,"fork":false,"pushed_at":"2020-08-25T08:59:40.000Z","size":535,"stargazers_count":126,"open_issues_count":4,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T19:51:15.363Z","etag":null,"topics":["vue","vue-component","vue2"],"latest_commit_sha":null,"homepage":null,"language":"Vue","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/Sopamo.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}},"created_at":"2016-11-23T10:14:29.000Z","updated_at":"2024-09-16T10:28:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb80d730-ef7d-4ed1-a679-da0d4bc0859e","html_url":"https://github.com/Sopamo/vue-online","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/Sopamo%2Fvue-online","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sopamo%2Fvue-online/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sopamo%2Fvue-online/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sopamo%2Fvue-online/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sopamo","download_url":"https://codeload.github.com/Sopamo/vue-online/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246743863,"owners_count":20826623,"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":["vue","vue-component","vue2"],"created_at":"2024-08-01T09:00:34.608Z","updated_at":"2025-04-02T02:32:12.856Z","avatar_url":"https://github.com/Sopamo.png","language":"Vue","funding_links":[],"categories":["实用库","Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","Vue"],"sub_categories":["Libraries \u0026 Plugins"],"readme":"# vue-online\n\n\u003e A reactive online/offline component for vue.js\n\n![Vue online preview](https://raw.githubusercontent.com/Sopamo/vue-online/master/preview.gif)\n\n# Installation\n    \n    npm install vue-online --save\n\n# Usage\nThat's a basic example of a component which would just show the offline message if the user has no connection:\n\n    \u003ctemplate\u003e\n      \u003cdiv id=\"app\"\u003e\n        \u003cOfflineIndicator\u003e\u003c/OfflineIndicator\u003e\n      \u003c/div\u003e\n    \u003c/template\u003e\n\n    \u003cscript\u003e\n    import { OfflineIndicator } from 'vue-online'\n\n    export default {\n      name: 'app',\n      components: {\n        OfflineIndicator\n      }\n    }\n    \u003c/script\u003e\n\n# Advanced usage (with the reactive online variable)\n\nYou can use ConnectionStatus.online anywhere in your app, it updates dynamically as the connection of the user changes.\n\n    \u003ctemplate\u003e\n      \u003cdiv id=\"app\"\u003e\n        Connection: \u003cspan v-if=\"online\"\u003eonline\u003c/span\u003e\u003cspan v-if=\"!online\"\u003eoffline\u003c/span\u003e\n        \u003cOfflineIndicator\u003e\u003c/OfflineIndicator\u003e\n      \u003c/div\u003e\n    \u003c/template\u003e\n\n    \u003cscript\u003e\n    import { OfflineIndicator, VueOnline } from 'vue-online'\n\n    export default {\n      name: 'app',\n      computed: {\n        online () {\n          return VueOnline.isOnline\n        }\n      },\n      components: {\n        OfflineIndicator\n      }\n    }\n    \u003c/script\u003e\n\n# Custom offline message\n\nTo use a custom message, simply specify it on the component:\n\n    \u003cOfflineIndicator message=\"Oh no, you're offline :(\"\u003e\u003c/OfflineIndicator\u003e\n\n\n# Custom styling\n\nTo style the offline indicator just use the css selector div.offline-indicator:\n\n    div.offline-indicator {\n      background: red;\n      color: white;\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSopamo%2Fvue-online","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSopamo%2Fvue-online","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSopamo%2Fvue-online/lists"}