我在 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; }};
添加谷歌分析事件后,vue 點擊事件被破壞?
開滿天機
2023-08-18 14:01:05