vue路由$router.push传递Date对象

this.$router.push({path:'/',query:{curDate:JSON.stringify(this.theMonth)}})
new Date(JSON.parse(this.$route.query.curDate))

先转为json字符串,接收后转为json对象
不转为json字符串是不可以用$route.query来接收的

发布了122 篇原创文章 · 获赞 5 · 访问量 4830

猜你喜欢

转载自blog.csdn.net/weixin_41254345/article/details/104481888