@jctrans-materials/nuxt 1.0.37-beta.6 → 1.0.37-beta.7
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.
- package/dist/module.d.cts +1 -0
- package/dist/module.d.mts +1 -0
- package/dist/module.d.ts +1 -0
- package/dist/module.json +1 -1
- package/dist/runtime/plugin.client.js +16 -7
- package/package.json +5 -5
package/dist/module.d.cts
CHANGED
package/dist/module.d.mts
CHANGED
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRuntimeConfig, useRouter } from "#app";
|
|
2
2
|
import { tracker } from "@jctrans-materials/shared";
|
|
3
|
+
import { nextTick } from "vue";
|
|
3
4
|
const pickString = (...values) => {
|
|
4
5
|
for (const value of values) {
|
|
5
6
|
if (typeof value === "string") {
|
|
@@ -21,6 +22,7 @@ const pickBoolean = (...values) => {
|
|
|
21
22
|
return void 0;
|
|
22
23
|
};
|
|
23
24
|
const getGlobalTrackingConfig = (globalVarName) => {
|
|
25
|
+
if (typeof window === "undefined") return {};
|
|
24
26
|
const currentWindow = window;
|
|
25
27
|
const fromCustom = currentWindow?.[globalVarName];
|
|
26
28
|
const fromJctrans = currentWindow?.__JCTRANS_GIO_CONFIG__;
|
|
@@ -189,7 +191,9 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
189
191
|
bindTrackHandler(element, binding, gio);
|
|
190
192
|
},
|
|
191
193
|
updated(element, binding) {
|
|
192
|
-
|
|
194
|
+
if (JSON.stringify(binding.value) !== JSON.stringify(binding.oldValue)) {
|
|
195
|
+
bindTrackHandler(element, binding, gio);
|
|
196
|
+
}
|
|
193
197
|
},
|
|
194
198
|
beforeUnmount(element) {
|
|
195
199
|
removeElementHandler(element);
|
|
@@ -197,13 +201,18 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
197
201
|
};
|
|
198
202
|
nuxtApp.vueApp.directive(directiveName, trackDirective);
|
|
199
203
|
if (initOptions.trackPage === false && initOptions.autoTrackPage) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
if (import.meta.client) {
|
|
205
|
+
router.afterEach((to) => {
|
|
206
|
+
setTimeout(async () => {
|
|
207
|
+
await nextTick();
|
|
208
|
+
gio.setPageAttributes({
|
|
209
|
+
route_name: String(to.name || ""),
|
|
210
|
+
route_path: to.path
|
|
211
|
+
});
|
|
212
|
+
gio.sendPage();
|
|
213
|
+
}, 50);
|
|
204
214
|
});
|
|
205
|
-
|
|
206
|
-
});
|
|
215
|
+
}
|
|
207
216
|
}
|
|
208
217
|
return {
|
|
209
218
|
provide: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jctrans-materials/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.37-beta.
|
|
4
|
+
"version": "1.0.37-beta.7",
|
|
5
5
|
"description": "Nuxt module for JCtrans UI components",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"nuxt": "^3.0.0",
|
|
23
23
|
"vue": "^3.5.26",
|
|
24
24
|
"vue-router": "^4.6.4",
|
|
25
|
-
"@jctrans-materials/comps-vue3": "1.0.37-beta.
|
|
26
|
-
"@jctrans-materials/shared": "1.0.37-beta.
|
|
25
|
+
"@jctrans-materials/comps-vue3": "1.0.37-beta.7",
|
|
26
|
+
"@jctrans-materials/shared": "1.0.37-beta.7"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"nuxt": "^3.0.0",
|
|
30
|
-
"@jctrans-materials/comps-vue3": "1.0.37-beta.
|
|
31
|
-
"@jctrans-materials/shared": "1.0.37-beta.
|
|
30
|
+
"@jctrans-materials/comps-vue3": "1.0.37-beta.7",
|
|
31
|
+
"@jctrans-materials/shared": "1.0.37-beta.7"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@nuxt/module-builder": "latest",
|