Detailed explanation of Vue router routing

Detailed explanation of Vue router routing

1. Basic use

2. Several points to note

3. Multi-level routing (multi-level routing)

4. Routing query parameters

5. Named Routes

For example, if you want to write a three-level directory, you need to bring the first and second level directories every time, which is troublesome. If you use named routing, you can directly find it by name.

6. Params parameters of routing

1) When configuring the route, you need to declare the receiving params parameter first, that is, take up a placeholder first

2)

7. Routing props configuration

When the replace attribute of router-link is turned on, the current route jump will overwrite the previous route history record.

8. Programmatic routing navigation

Cache routing components so that components written in include will not be destroyed when switching. If you don't write include, everything will be cached

9. Cache routing components

How to write multiple caches:

Two lifecycle hooks related to routing components:

1. Function : Two hooks unique to routing components, used to capture the activation status of routing components.

Summarize

This article ends here. I hope it can be helpful to you. I also hope you can pay more attention to more content on 123WORDPRESS.COM!

You may also be interested in:
  • VueJs routing jump - detailed explanation of the use of vue-router
  • Detailed explanation of four ways of vue routing jump (with parameters)
  • Three ways to clear history of vue routing jump router-link (summary)

<<:  How to use css overflow: hidden (overflow hiding and clearing floats)

>>:  40 CSS/JS style and functional technical processing

Blog    

Recommend

The pitfall record of the rubber rebound effect of iOS WeChat H5 page

Business requirements One of the projects I have ...

Detailed tutorial on how to automatically install CentOS7.6 using PXE

1. Demand The base has 300 new servers, and needs...

HTML Basics: The basic structure of HTML

The basic structure of HTML hypertext documents is...

Sample code for using CSS to write a textured gradient background image

The page length in the project is about 2000px or...

Summary of knowledge points about covering index in MySQL

If an index contains (or covers) the values ​​of ...

Sample code of uniapp vue and nvue carousel components

The vue part is as follows: <template> <...

About WeChat Mini Program to implement cloud payment

Table of contents 1. Introduction 2. Thought Anal...

How to maintain a long connection when using nginx reverse proxy

· 【Scene description】 After HTTP1.1, the HTTP pro...

How to use css overflow: hidden (overflow hiding and clearing floats)

Overflow Hide It means hiding text or image infor...

Some useful meta setting methods (must read)

<meta name="viewport" content="...

Nodejs-cluster module knowledge points summary and example usage

The interviewer will sometimes ask you, tell me h...

How to install phabricator using Docker

I am using the Ubuntu 16.04 system here. Installa...