Check Internet Availability for your vue app
npm install vue-internet-checkerbash
npm install vue-internet-checker
or
yarn add vue-internet-checker
`
CDN: UNPKG | jsDelivr (available as window.vueInternetChecker)
:white_check_mark: Usage :mortar_board:
Register the component globally:
`javascript
Vue.component('vueInternetChecker', require('vue-internet-checker'));
`
Or use locally
`javascript
import vueInternetChecker from 'vue-internet-checker';
`
:white_check_mark: Example :four_leaf_clover:
$3
`html
@status="status"
@event="event"
/>
`
$3
`javascript
import vueInternetChecker from 'vue-internet-checker';
export default {
components: {
vueInternetChecker,
},
data: () => ({
onLine: null,
}),
methods: {
status(ele) {
console.log(ele);
this.onLine = ele;
},
event(ele) {
console.log(ele);
},
},
};
`
$3
`css
`
$3
| Name | Description |
| -------------------- | --------------------------------------------------------------------------- |
| status | Emits an Boolean value which can be used for multiple purposes in your app. |
| event | |
Contributing
1. Fork it!
2. Create your feature branch: git checkout -b my-new-feature
3. Commit your changes: git commit -am 'Add some feature'
4. Push to the branch: git push origin my-new-feature`