Other properties vue router, the value of the transfer, lazy loading

The router-link routing tag has several other attributes:

 

 

 

 

Route can pass values ​​(id passed generally used as entry, after acquiring the data from the display page with the id axios

first step:

  Define routing and name attribute values ​​(after which the route after the jump page, then use to get the value of this property name

   

 

 

 Step two:

   The specified routing links and value in route-link tag, worded as follows

  

 

 third step:

  Id value passed passed 33

 

 

   We need to get it, then we get the definition of a calculated property value

 

 

Routing of lazy loading:

Routing lazy loading 
when constructing packaged application, js package will become very large, affecting page load 
components if we could split into different routes corresponding code blocks do not, and then when the route is accessible only to load the corresponding components 
    so that more efficient the 
official trying to say? 
    First of all, we know that the route is usually defined in a number of different pages 
    These pages are ultimately placed in a js file 
    , however, so much put a js file which will inevitably result in a very large page 
routing lazy loading what has been done? 
    The main role is to route the corresponding components packaged into a code block one of js 
    only the route to be accessed when it loads the corresponding components

 

  

To achieve the following:

 

 

 

   

Guess you like

Origin www.cnblogs.com/cl94/p/12359329.html