Last active
April 8, 2019 07:44
-
-
Save xesjkeee/7ce8e53ec7b53bd7a2b606be793197df to your computer and use it in GitHub Desktop.
Get UTM in Vue.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computed: { | |
UTM() { | |
const { query } = this.$route | |
let res = '/?' | |
let index = 0 | |
for (let key in query) { | |
if (index > 0) res += `&` | |
res += `${key}=${query[key]}` | |
index++ | |
} | |
return res | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment