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]
        })

 

上一篇:preload hook


下一篇:HCIP课程笔记-13-BGP选路原则