From 679d49def0dbd422a72527d0a4596af3cb141ddc Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 14 Mar 2020 11:19:56 +0100 Subject: pick a word by HTTP GET --- assets/web.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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); + } + }); } }); -- cgit v1.2.3