0.1.4 • Published 3 years ago

@sten-agency/vue-env-notify v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Vue Env Notify

A VueJS package to let you know the environment you are currently interacting with in the browser.

Known Vulnerabilities

npm version

yarn add @sten-agency/vue-env-notify 

# npm i @sten-agency/vue-env-notify

Setup

Add id="favicon" to your link tag for favicon.

import Vue from 'vue'
import vueEnvNotify from "@sten-agency/vue-env-notify";

Vue.use(vueEnvNotify, {
  env: process.env.NODE_ENV,
  trackNetwork: true,
  offlineFavicon: null,
  envAssets: {
    development: null,
    staging: null,
    production: null,
  },
});

Options

NameTypeDescription
envStringSet the NODE_ENV enviroment variable
trackNetworkBooleanSet to true or false
offlineFaviconStringURL of your offline favicon
envAssetsObjectURL for the different environments

Functions

NameUsage
setTitlevueEnvNotify.setTitle(process.env.NODE_ENV, this.$route.meta.title);

To use page title features, follow the step below

In your App.vue file

  1. Import vue-env-notify - import vueEnvNotify from "@sten-agency/vue-env-notify";
  2. Add the code below to the mounted hook
vueEnvNotify.setTitle(process.env.NODE_ENV, this.$route.meta.title);
  1. Also watch for changes on $route(to)
$route(to) {
  vueEnvNotify.setTitle(process.env.NODE_ENV, to.meta.title);
},

and last don't forget to add meta.title to your route file like below.

meta: {
  title: "Home Page", 
},
0.1.4

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago