@eventra_dev/cli-plugin-vue 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -112,8 +112,10 @@ The prop does not have to be named `event`. If a component sends one of its prop
112
112
  ```vue
113
113
  <!-- Button.vue -->
114
114
  <script setup lang="ts">
115
+ import { Eventra } from '@eventra_dev/eventra-sdk'
116
+ const tracker = new Eventra({ apiKey: 'YOUR_KEY' })
115
117
  const props = defineProps<{ analyticsName: string }>()
116
- function onClick() { trackEvent(props.analyticsName) }
118
+ function onClick() { tracker.track(props.analyticsName) }
117
119
  </script>
118
120
  <template><button @click="onClick"><slot /></button></template>
119
121
 
@@ -124,7 +126,7 @@ import Button from './Button.vue'
124
126
  <template><Button analytics-name="checkout.cta">Pay</Button></template>
125
127
  ```
126
128
 
127
- `checkout.cta` is found. It works with `defineProps<{ ... }>()`, `defineProps([...])`, `defineProps({ ... })`, `withDefaults(...)`, a props object (`const props = defineProps(...)`) and a destructuring (`const { analyticsName } = defineProps(...)`), and also when the template reads the prop by its bare name (`@click="trackEvent(analyticsName)"`). A prop handed on to another component (`<Inner :name="props.analyticsName" />`) is followed. Props the component never tracks are not events. A prop that comes from a `v-for` variable is reported as a dynamic occurrence.
129
+ `checkout.cta` is found. It works with `defineProps<{ ... }>()`, `defineProps([...])`, `defineProps({ ... })`, `withDefaults(...)`, a props object (`const props = defineProps(...)`) and a destructuring (`const { analyticsName } = defineProps(...)`), and also when the template reads the prop by its bare name (`@click="tracker.track(analyticsName)"`). A prop handed on to another component (`<Inner :name="props.analyticsName" />`) is followed. Props the component never tracks are not events. A prop that comes from a `v-for` variable is reported as a dynamic occurrence.
128
130
 
129
131
  Not followed: Options API components (`props: [...]` read through `this`), `v-bind="obj"` spreads, components registered by name instead of imported, and a component whose normal `<script>` has its own `export default`.
130
132
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventra_dev/cli-plugin-vue",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Eventra CLI plugin — extract track() calls from Vue SFC (.vue) files",
5
5
  "license": "MIT",
6
6
  "author": {