Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

@ichnos/vue

1.0.2 • Public • Published

@ichnos/vue

Vue plugin for ichnos

Install

npm install @ichnos/vue

Setup Vue plugin

import { plugin } from '@ichnos/vue'
import Vue from 'vue'
 
Vue.use(plugin, {
  events: [{ type: 'addToCart' }],
  options: {
    id: 'GTM-XXXX',
    active: true
  },
  beforeSend: event => ({
    event: 'my_app_events',
    ...event
  })
})

then, ichnos instance will be available via $ichnos in vue instance. next, you can either fire events imperatively using send method or use ichnos as vue-directive

Using directive

Below example to fire focusin event

<button v-ichnos:click.addToCart="{ category: 'xyz' }" />

Fire events Imperatively

in any vue component you will access to $ichnos instance to fire any event using send method.

const { send, events } = this.$ichnos
send(events.addToCart({ category: 'xyz' }))

Install

npm i @ichnos/vue

DownloadsWeekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

36.7 kB

Total Files

13

Last publish

Collaborators

  • avatar