Vue tips Vue tips Mar 3, 2022 Vue的生命周期中, $rounter 可能在 created 和 mounted 阶段并没有初始化好,这时使用 push 或者 replace 是无效的,这时我们可以使用这个方法来解决这个问题:this.queryParams = this.$route.query this.$router.onReady(() => { this.$router.push({ query }) }) Share Tweet Written by: LeeChen