Commit 27dbe587a9e8fb49427b0eb92fec0079fc428bbb
1 parent
9d346e3b
fix: 修改contact页面bug,prod2-67/68
Showing
3 changed files
with
11 additions
and
5 deletions
components/Header.vue
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 | </template> |
81 | 81 | |
82 | 82 | <script setup lang="ts"> |
83 | -import { ref, watchEffect } from "vue"; | |
83 | +import { ref, watchEffect, onMounted } from "vue"; | |
84 | 84 | import ContactDialog from "@/components/ContactDialog.vue"; |
85 | 85 | import { useProductListStore } from "@/stores/product_list"; |
86 | 86 | import { useRouter } from "vue-router"; | ... | ... |
deploy/prod2.sh
pages/contact.vue
... | ... | @@ -239,7 +239,7 @@ |
239 | 239 | </template> |
240 | 240 | |
241 | 241 | <script setup lang="ts"> |
242 | -import { ref, reactive } from "vue"; | |
242 | +import { ref, reactive, onMounted } from "vue"; | |
243 | 243 | import { useVuelidate } from "@vuelidate/core"; |
244 | 244 | import { email, required, maxLength } from "@vuelidate/validators"; |
245 | 245 | |
... | ... | @@ -367,7 +367,13 @@ useHead({ |
367 | 367 | title: "Contact", |
368 | 368 | }); |
369 | 369 | |
370 | -window.addEventListener('load', function (event) { if (window.location.href.includes("contact")) { gtag('event', 'conversion', {'send_to': 'AW-881504701/HtNtCIqB-bQaEL3jqqQD'}); } }); | |
370 | +onMounted(() => { | |
371 | + window.addEventListener('load', function (event) { | |
372 | + if (window.location.href.includes("contact")) { | |
373 | + gtag('event', 'conversion', {'send_to': 'AW-881504701/HtNtCIqB-bQaEL3jqqQD'}); | |
374 | + } | |
375 | + }); | |
376 | +}); | |
371 | 377 | |
372 | 378 | </script> |
373 | 379 | ... | ... |