Jump Vue same route with different parameters, to solve the data page does not automatically refresh

reference:

https://www.cnblogs.com/ainyi/p/9340311.html

https://blog.csdn.net/weixin_41888813/article/details/86735664

  Created () {
     the this .fetchLink () 
  }, 

  Watch: { 
    // monitor parameters at the same time routed to asynchronous refresh 
    '$ route' (to, from) {
       // do some routing changes in response to 
      the this .loading = to true ;
       the this .fetchLink () 
    } 
  }, 

  Methods: { 
    fetchLink () { 
      resourcemgApi.zypriceSearch ( the this . $ route.params.name) .then (RESP => [
         the this .list = resp.data, 
        the console.log ( the this .list) 
      ]) 
    } 
  },

 

Guess you like

Origin www.cnblogs.com/flypig666/p/11762640.html