Skip to content

Commit 8d2ec45

Browse files
committed
fix(vue): global properties are prefixed with $ to align with Vue spec
1 parent 547b994 commit 8d2ec45

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

packages/vue/src/utils.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { SUPPORTED_ANALYTICS_PLATFORMS } from '@web-analytics/core'
12
import type { Platform } from '@web-analytics/core'
23
import type { VueInstance } from './types'
34

@@ -12,17 +13,6 @@ export function getMajorVersion({ version }: VueInstance) {
1213
}
1314

1415
export function getGlobalProperty(platform: Platform) {
15-
switch (platform) {
16-
case 'baidu': {
17-
return 'baiduAnalytics'
18-
}
19-
20-
case 'cnzz': {
21-
return 'cnzzAnalytics'
22-
}
23-
24-
default: {
25-
return ''
26-
}
27-
}
16+
if (!SUPPORTED_ANALYTICS_PLATFORMS.includes(platform)) return ''
17+
return `$${platform}Analytics`
2818
}

0 commit comments

Comments
 (0)