Created
December 4, 2019 14:57
-
-
Save krzysztofjeziorny/db53032669259d485e5d66bbb435151b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Take a parameter from the URL ie. /?myparam=value | |
created() { | |
let uri = window.location.search.substring(1) | |
let params = new URLSearchParams(uri) | |
if (params.get("myparam") !== null) { | |
console.log(`My URL parameter: ` + params.get("myparam")) | |
this.something = params.get("myparam") | |
this.myFunction() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment