vue.js - 在 vue-router 中重定向时如何从 VueJS 中的 URL 传递道具?
问题描述
我有在 4 秒内重定向用户的功能,但我需要以某种方式传递道具:
setTimeout(() => {
clearInterval(intervalId)
this.$router.push({ path: `/${this.$store.state.locale}/my-cart` })
}, 4000)
我试图做这样的事情:
this.$router.push({ name: '/${this.$store.state.locale}/my-cart', params: {step: '2'} })
这不起作用,这条路线在主页上重定向,那么,我该怎么做?
解决方案
this.$router.push({ path: '/${this.$store.state.locale}/my-cart', params: {step: '2' }})
请更改name
并替换path
为代码
推荐阅读
- python - 如何使用python将从excel中提取的数据输入到网站中?
- java - 在 Android Studio 中根据参数舍入浮点数或双精度数
- java - 如何修复 NoSuchElementException 扫描程序?
- java - 如何在heroku中获取我的项目的公共IP?
- git - GitHub 创建子模块而不是简单的文件夹
- javascript - 如何正确使用一个“当前”数组来管理多个数组?
- javascript - Uncaught (in promise) TypeError: Cannot read property 'forEach' of undefined (JavaScript)
- python - 如何让每个线程从我的 txt 文件中逐行使用下一个用户代理
- unity3d - 为什么这个计算着色器会跳过每 17 个缓冲区值?
- python - Twitter API created_at 字段值“行为有趣”