diff options
author | ache <ache@ache.one> | 2020-03-14 11:19:56 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2020-03-14 11:19:56 +0100 |
commit | 679d49def0dbd422a72527d0a4596af3cb141ddc (patch) | |
tree | 5ce48ed0938720c9b93b132d5c806fa68a01b87d | |
parent | Regex support (diff) |
pick a word by HTTP GET
-rw-r--r-- | assets/web.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/assets/web.js b/assets/web.js index 7b9bce5..3801335 100644 --- a/assets/web.js +++ b/assets/web.js @@ -52,5 +52,14 @@ const web = new Vue({ } this.timer = setTimeout(this.searchWord, 800); } + }, + mounted: function() { + const param = window.location.search.substr(1); + + param.split('&').forEach( p => { + if (p.startsWith('w=')) { + this.word = p.slice(2); + } + }); } }); |