0.0.6 • Published 5 years ago

vue-track-reloads v0.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

vue-track-reloads

A vue component that tracks how many times a user reloads the page and will perform an action if a threshold is reached.

Installation

npm install vue-track-reloads --save

Default import

import Vue from 'vue'
import TrackReloads from 'vue-track-reloads'

Vue.use(TrackReloads)

Usage

After installing, simply use the component in your vue template

<template>
  <vue-track-reloads :maxReloads=5 :maxReloadsHandler="myHandler" :showInfo=false />
</template>

Properties / Attributes

You can make use of the following to customize.

PropertyTypeDescriptionDefault
maxReloadsNumberNumber of max reloads allowed.3
maxReloadsHandlerFunctionFunction to execute when max reloads are reached.alert
showInfoBooleanWill display the replay count info in the DOM.true

Note: if you choose to show the reload count info, I have not added any styles. However, I have added classes to the elements for you to easily style them.

Local Development

Clone the repo to your machine and change to the directory, then..

npm install
npm run dev

Production Build

npm run build

Credits

The inspiration for this component came from this article on CSSTricks by Mateusz Rybczonek. While some of the functions are the same, I have also expanded on some of them and added my own.

0.0.5

5 years ago

0.0.6

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago