解决Vue项目中在地址栏拿不到route.query的参数问题

2020-08-31  本文已影响0人  生于乱世
示例:
this.$router.onReady(() => {
  if(this.$route.query.source != undefined && this.$route.query.source != null){

    localStorage.setItem("source",this.$route.query.source)
  }
 })

通过this.$router.onReady(() => {})来取得想要的参数

上一篇 下一篇

猜你喜欢

热点阅读