如何使用window.location.href从Vue中的url中检索数据

时间:2018-03-30 12:07:53

标签: javascript vue.js vue-router

我有数据要传递给其他页面。

使用this.$router.push({ name: 'toAnotherPage', params: { info: this.info}})非常有效,因为我使用SPA时没有刷新新页面。如果我可以让它刷新新页面,我会没事的。

使用window.location.href = '/toAnotherPage?info=' + this.infoinfo重定向到新页面但有挑战检索它。

我尝试使用this.$route.query.info但没有工作。

我需要帮助。感谢

0 个答案:

没有答案