Skip to content

Instantly share code, notes, and snippets.

@xesjkeee
Last active April 8, 2019 07:44
Show Gist options
  • Save xesjkeee/7ce8e53ec7b53bd7a2b606be793197df to your computer and use it in GitHub Desktop.
Save xesjkeee/7ce8e53ec7b53bd7a2b606be793197df to your computer and use it in GitHub Desktop.
Get UTM in Vue.js
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