第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

添加谷歌分析事件后,vue 點擊事件被破壞?

添加谷歌分析事件后,vue 點擊事件被破壞?

開滿天機 2023-08-18 14:01:05
我在 vue 中的鏈接上有一個點擊事件,該鏈接啟動了一個模式,該模式有一個鏈接將用戶引導(dǎo)到另一個網(wǎng)站。一切都按預(yù)期工作,直到我剛剛添加了谷歌分析點擊事件。現(xiàn)在模式打開,但到另一個站點的鏈接只是返回到主頁 /root。有沒有辦法在不中斷的情況下調(diào)用鏈接上的兩個點擊事件?啟動模式并鏈接出的鏈接:             <a              href="https://www.linkout.com"              rel="noopener"              @click.prevent="                openInterstitial;                $ga.event('link', 'click', 'ISI_link');              "              target="_blank"              >www.linkout.com</a            >mixin method:Vue.mixin({  methods: {      openInterstitial(event) {        if (event) {          event.preventDefault();          this.$store.commit('modals/setInterstitialHref', event.target.href);        }        this.$store.commit('modals/setShowInterstitial', true);      }    }  });店鋪export const state = () => ({  interstitial: {    show: false,    href: ''  }});export const mutations = {  setShowInterstitial(state, boolean) {    state.interstitial.show = boolean;  },  setInterstitialHref(state, string) {    state.interstitial.href = string;  }};
查看完整描述

1 回答

?
炎炎設(shè)計

TA貢獻1808條經(jīng)驗 獲得超4個贊

我重現(xiàn)了您的問題,似乎您的openInterstitial方法根本沒有被調(diào)用。問題是您使用該方法來訪問事件數(shù)據(jù)(不帶括號的用法)。因此,你不能像以前那樣鏈接它們,它不會被執(zhí)行。如果您使用單個處理程序,則只能省略括號。

您可以做的是使用帶括號的方法并使用$event(?Docs?) 傳遞事件數(shù)據(jù)。

@click.prevent="
??openInterstitial($event);
??$ga.event('link',?'click',?'ISI_link');
"

這樣您就可以訪問事件數(shù)據(jù)并鏈接多個方法。希望能解決您的問題!



查看完整回答
反對 回復(fù) 2023-08-18
  • 1 回答
  • 0 關(guān)注
  • 115 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號