vue-online-offline
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

vue-online-offline

Vue Component with online/offline slots

Project setup

npm install vue-online-offline

or

yarn add vue-online-offline

Usage

<template>
  <vue-online-offline @online="isOnline" @offline="isOffline">
    <div slot="online">I'm online! 🎉</div>
    <div slot="offline">I'm offline. 🤨</div>
  </vue-online-offline>
</template>
 
<script>
import VueOnlineOffline from 'vue-online-offline'
 
export default {
  components: { VueOnlineOffline },
  methods: {
    isOnline() {
      console.log(`Now I'm online!`)
    },
    isOffline() {
      console.log(`Now I'm offline.`)
    }
  }
}
</script>

Readme

Keywords

none

Package Sidebar

Install

npm i vue-online-offline

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

66.6 kB

Total Files

12

Last publish

Collaborators

  • julienc6