vue-lifecycle-log

1.2.0 • Public • Published

npm version

Vue lifecycle log

A Vue.js plugin to log lifecycles of the components

Usage

Installation

npm install --save vue-lifecycle-log

Import it on your entry file (normally main.js) and use it with Vue. It is automatically disabled on production mode.

import Vue from 'vue'
import LogLifecycles from 'vue-lifecycle-log'
 
Vue.use(LogLifecycles)

It uses the component's name for logging, so if you don't have it defined, it will print undefined

log example

Configuring lifecycles to print

The lifecycles to print can be filtered by passing an array in the plugin options, like:

import Vue from 'vue'
import LogLifecycles from 'vue-lifecycle-log'
 
Vue.use(LogLifecycles, { lifecycles: ['created', 'beforeDestroy'] })

Configuring components to print

The component's name to print can be filtered by passing an array in the plugin options, like:

import Vue from 'vue'
import LogLifecycles from 'vue-lifecycle-log'
 
Vue.use(LogLifecycles, { components: ['component1', 'component2'] })

Passing an empty array will print all of them.

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i vue-lifecycle-log

    Weekly Downloads

    4

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    27.7 kB

    Total Files

    5

    Last publish

    Collaborators

    • fcalabria