@ichnos/vue
TypeScript icon, indicating that this package has built-in type declarations

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' }))

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.20latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.20
1.0.10
1.0.00
0.0.140
0.0.130
0.0.100
0.0.10-alpha.00
0.0.9-alpha.00
0.0.8-alpha.00

Package Sidebar

Install

npm i @ichnos/vue

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

36.7 kB

Total Files

13

Last publish

Collaborators

  • tmohamed1