mirror of
https://github.com/Art051/it-tools.git
synced 2025-08-11 19:29:03 +00:00
refactor(tracker): better tracker injection
This commit is contained in:
@@ -9,6 +9,7 @@ import { config } from '@/config';
|
||||
import MenuIconItem from '@/components/MenuIconItem.vue';
|
||||
import type { Tool } from '@/tools/tools.types';
|
||||
import { useToolStore } from '@/tools/tools.store';
|
||||
import { useTracker } from '@/modules/tracker/tracker.services';
|
||||
import SearchBar from '../components/SearchBar.vue';
|
||||
import HeroGradient from '../assets/hero-gradient.svg?component';
|
||||
import MenuLayout from '../components/MenuLayout.vue';
|
||||
@@ -23,6 +24,8 @@ const commitSha = config.app.lastCommitSha.slice(0, 7);
|
||||
const makeLabel = (tool: Tool) => () => h(RouterLink, { to: tool.path }, { default: () => tool.name });
|
||||
const makeIcon = (tool: Tool) => () => h(MenuIconItem, { tool });
|
||||
|
||||
const { tracker } = useTracker();
|
||||
|
||||
const toolStore = useToolStore();
|
||||
|
||||
const menuOptions = computed<MenuGroupOption[]>(() =>
|
||||
@@ -157,7 +160,7 @@ const menuOptions = computed<MenuGroupOption[]>(() =>
|
||||
target="_blank"
|
||||
class="support-button"
|
||||
:bordered="false"
|
||||
@click="() => $tracker.trackEvent({ eventName: 'Support button clicked' })"
|
||||
@click="() => tracker.trackEvent({ eventName: 'Support button clicked' })"
|
||||
>
|
||||
Buy me a coffee
|
||||
<n-icon v-if="!styleStore.isSmallScreen" :component="Heart" style="margin-left: 5px" />
|
||||
|
||||
Reference in New Issue
Block a user