0.1.1 • Published 12 months ago

v-track-plus v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

v-track-plus

Vue Element Track

NpmVersion npm

Install

$ npm install v-track-plus --save

Use

src/main.js

Types

interface TrackOptions {
  baseURL: string;
  baseParams?: any;
  baseCallBack?: (url: string, trackType: string, params: any) => void;
}

interface TrackValue {
  url?: string;
  params?: any;
  triggerEvent?: string;
  interval?: number;
  callback?: (url: string, trackType: string, params: any) => void;
}

interface TrackParam {
  url: string;
  params: any;
  trackType: string;
  triggerEvent: string;
  interval: number;
  callback: (url: string, trackType: string, params: any) => void;
}

Vue2

import { vTrack } from '@dgov/web-plugin'

Vue.use(vTrack, options: TrackOptions)

Vue3

import { vTrackPlus } from '@dgov/web-plugin'

app.use(vTrackPlus, options: TrackOptions)

*.vue

<template>
  <!-- Default Click Event -->
  <button v-track>Click</button>
  <!-- TrackValue TrackValue[]-->
  <button v-track:click|keyboard:13="{ url: '111', params: params }">TrackValue</button>
  <button
    v-track:click|keyboard:13="[
      { url: '111', params: params },
      { url: '222', params: params, triggerEvent: 'click' }
    ]"
  >
    TrackValue[]
  </button>
</template>

<script>

export default {
  data() {
    return {
      params: {
        id: 1
      }
    }
  }
}
</script>
0.1.1

12 months ago

0.1.0

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago