Vue 3 组件和可组合函数,用于通过反应性状态和可自定义的轮询检测在线和离线网络状态。
⚠️ Docs are for Vue 3, for Vue 2 docs, click here
pnpm add v-offline@latestpnpm add v-offline@legacy
then import the file in `nuxt.config.{j|t}s`:
```js
export default {
// ...
plugins: [
// ...
{ src: '~/plugins/v-offline', mode: 'client' },
// ...
],
// ...
};
| 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. |
| Name | Returns | Description |
|---|---|---|
@detected-condition |
String | Emits a boolean value |
git checkout -b feat/new-feature)git commit -Sam 'feat: add feature')git push origin feat/new-feature)Note:
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
暂无开放 Issues,或尚未同步最近议题。