如何在不使用vue路由器的情况下从vue组件重定向到laravel路由
我正在尝试使用window.location从Vue组件重定向到Laravel路由,但出现get a 404错误页面 这是我被重定向到的页面 这是我从vue组件重定向到laravel路由的代码如何在不使用vue路由器的情况下从vue组件重定向到laravel路由,laravel,vue.js,Laravel,Vue.js,我正在尝试使用window.location从Vue组件重定向到Laravel路由,但出现get a 404错误页面 这是我被重定向到的页面 这是我从vue组件重定向到laravel路由的代码 async onSave() { this.errors = {}; await Api().post('/stocks/store',this.form) .then((response)=>{ window.locat
async onSave() {
this.errors = {};
await Api().post('/stocks/store',this.form)
.then((response)=>{
window.location = Api().get('/stocks/'+response.data.id+'/show');
})
.catch((error) => {
if(error.response.status === 422) {
this.errors = error.response.data.errors
}
})
}
使用标记重定向页面
let link = document.createElement('a')
link.href = "Your XYZ Link"
link.click()
为什么不使用这个。$router.push`@CamB$oKiDz不能使用$router.push是因为我没有构建单页应用程序