実現したいこと
location.hrefで遷移したい
発生している問題
location.hrefで遷移しない。VueのSFCをTypeScriptで書いていたときに起きました
関連するコード
Javascript
1fetch("/signin", { 2 method: "POST", 3 body: JSON.stringify({ user: this.rdata[0], password: this.rdata[1] }), 4 headers: { "Content-Type": "application/json" } 5 }) 6 .then(res => { 7 return res.json(); 8 }) 9 .then(json => { 10 console.log(json); 11 if(json.err){ 12 console.log("err") 13 }else{ 14 window.location.href = location.host + "/myaccount/xxx" 15 } 16 });
環境
chrome: 72.0.3626.121 32bit
vue: 2.6.8
Vue-cli
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。