其他分享
首页 > 其他分享> > Nuxt $router.push 失效原因记录

Nuxt $router.push 失效原因记录

作者:互联网

<a @click="setCCY" class="dropdown-item" href="#">EUR</a>  ## href="#"此种写法有毒,相同path在调用

<a @click="setCCY" class="dropdown-item" href="javascript:void(0);">EUR</a> √
    setCCY(e){      
      this.ccy = e.target.text
        let obj = {}
        let attrs = []
        if(this.$route.query.Color!=null){
          obj['Color'] = this.$route.query.Color
        }
        if(this.$route.query.Color!=null){
          obj['Storage'] = this.$route.query.Storage
        } 
        if(this.$route.query.Color!=null){
          obj['Currency'] = e.target.text
        }            
        attrs.push(obj)            
        this.$router.push({
          path: this.$route.path,
          query: attrs[0]
        })

 

标签:obj,Color,route,attrs,query,push,router,path,Nuxt
来源: https://www.cnblogs.com/mincoivp/p/15924396.html