百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

v-offline

> 前端框架
开源

Vue 3 组件和可组合函数,用于通过反应性状态和可自定义的轮询检测在线和离线网络状态。

380 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Vue 3 组件和可组合函数,用于通过反应性状态和可自定义的轮询检测在线和离线网络状态。

V-Offline ⚡️

⚠️ Docs are for Vue 3, for Vue 2 docs, click here

Features

  • Detect offline & online events for your vue app.
  • Built from scratch usign Vue 2 & Composition API with TypeScript
  • For Vue >3.x version – pnpm add v-offline@latest
  • For Vue >=2.7 version – pnpm add v-offline@legacy
  • For Vue { nuxtApp.vueApp.component('VOffline', VOffline); });

then import the file in `nuxt.config.{j|t}s`:

```js
export default {
  // ...
  plugins: [
    // ...
    { src: '~/plugins/v-offline', mode: 'client' },
    // ...
  ],
  // ...
};

Example


  
    
      

    
    
      

    
  
  
  

API

Props

Name Type Required? Default Description
online-class String No '' Styling the div which you want to give if you're online.
offline-class String No '' Styling the div which you want to give if you're offline.
ping-url String No https://google.com Pinging any url to double check if you're online or not.

Events

Name Returns Description
@detected-condition String Emits a boolean value

Contributing

  1. Fork it ( https://github.com/vinayakkulkarni/v-offline/fork )
  2. Create your feature branch (git checkout -b feat/new-feature)
  3. Commit your changes (git commit -Sam 'feat: add feature')
  4. Push to the branch (git push origin feat/new-feature)
  5. Create a new Pull Request

Note:

  1. Please contribute using GitHub Flow
  2. Commits & PRs will be allowed only if the commit messages & PR titles follow the conventional commit standard, read more about it here
  3. PS. Ensure your commits are signed. Read why

Author

v-offline © Vinayak, Released under the MIT License.

Authored and maintained by Vinayak Kulkarni with help from contributors (list).

vinayakkulkarni.dev · GitHub @vinayakkulkarni · Twitter @_vinayak_k

License

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptawesome-vuedetection-networknetworkoffline

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架