当前位置:网站首页>Router. Push(), router. Reply(), router. Go()
Router. Push(), router. Reply(), router. Go()
2022-07-26 12:56:00 【songywaa】
router Object provides three methods for jumping links :
router.push( ... )=> Jump to a sub page , And in history Add a record torouter.repalce( ... )=> Replace the current page , In fact, it can also be understood as jump , and push The difference is not in history Add a record torouter.go(number)=> Just mentioned history, stay go() Is used in , Jump to the previous page go(-1), Just jump to the next page go(1), Of course, the premise of realizing jump is history There's a record in .
router. p u s h \color{red}{push} push(location, onComplete?, onAbort?)
| declarative | programmatic |
|---|---|
| < router-link :to="…"> | router.push(…) |
// Mode one : String path
router.push('/user')
// Mode two :path object
router.push({
path: '/user' })
// Mode three : Routing name
router.push({
name: 'user'})
notes It means : Such as fruit carry for 了 p a t h , p a r a m s Meeting By Suddenly A little , q u e r y No Meeting ! ! \color{green}{ Be careful : If provided path,params Will be ignored ,query Can't !!} notes It means : Such as fruit carry for 了 path,params Meeting By Suddenly A little ,query No Meeting !!
// Don't take effect
router.push({
path: '/user', params: {
id: 1 }})
// params take effect /user/1
router.push({
name: 'user', params: {
id: 1 }}) // Use name The way
router.push({
path: `/user/1` }) // Directly in path Up expansion
// query Unaffected /user?id=1
router.push({
path: '/user', query: {
id: 1 }})
router. r e p l a c e \color{red}{replace} replace(location, onComplete?, onAbort?)
| declarative | programmatic |
|---|---|
| < router-link :to="…" replace> | router.replace(…) |
Follow r o u t e r . p u s h very image , only One Of No Same as Just yes , it No Meeting towards h i s t o r y add Add new remember record ! \color{green}{ Follow router.push It's like , The only difference is , It doesn't go to history Add new record !} Follow router.push very image , only One Of No Same as Just yes , it No Meeting towards history add Add new remember record !
router. g o \color{red}{go} go(n)
stay history Record how many steps forward or backward , similar window.history.go(n)
// Take a step forward in browser logging , Equate to history.forward()
router.go(1)
// Step back to record , Equate to history.back()
router.go(-1)
// Forward 3 Step record
router.go(3)
// If history Not enough records , Then fail silently , Don't complain
router.go(-100)
router.go(100)
边栏推荐
- Uniapp H5, APP references external online JS
- Flutter textfield sets the height and automatically wraps lines, and the rounded border removes the underline
- Who is responsible for the problems of virtual idol endorsement products? And listen to the lawyer's analysis
- Database composition view
- Backtracking - 491. Incremental subsequence
- Does anyone know where the retract of flinksql can be specified? Only api code settings can be seen in online materials
- Kubernetes---- installing and deploying NFS servers
- V00 - do whatever you want when you are old
- 食品安全 | 微波炉什么食品都能加热?这些安全隐患要知道
- The strongest tool class of entity mapping: mapstruct Zhenxiang
猜你喜欢

LCD notes (7) LCD driver framework_ Configure clock

The.Net webapi uses groupname to group controllers to render the swagger UI

Kuzaobao: summary of Web3 encryption industry news on July 25

高通再次「押宝」中科创达,挑战智能驾驶软硬件全栈方案

Removable tablespace

Paper reading MLPD: multi label pedestrian detector in multispectral domain (Internship Program of Hikvision Research Institute)

Detailed interpretation of hole convolution (input and output size analysis)

Food safety | can you eat any fruit?

The programmed navigation route jumps to the current route (the parameters remain unchanged), and if it is executed multiple times, it will throw a navigationduplicated warning error?

VS code 设置Ctrl+S保存,自动格式化的方法
随机推荐
虚拟偶像代言产品出问题谁负责?且听律师分析
The database consists of stored procedures and functions
How to remove underline and color when there is focus in the shutter textfield
Guys, please ask me, I have configured CDC to connect to Oracle according to the document, and I always run error reports and can't find the class validstione
关于自动重复调用接口的一种实现方式-反射
Transactional transaction propagation behavior?
V00 - do whatever you want when you are old
Data query function
Vs code set the method of ctrl+s saving and automatic formatting
2022 employment season! Adobe helps creative industry workers break through the shackles of skills and return to the source of ability
数据库组成表
Understand test.py in gaitset
【TypeScript】TypeScript常用类型(上篇)
Interview JD T5, was pressed on the ground friction, who knows what I experienced?
14.2 byte stream learning
Huawei recruited "talented teenagers" twice this year; 5.4 million twitter account information was leaked, with a selling price of $30000; Google fired engineers who believed in AI consciousness | gee
Kuzaobao: summary of Web3 encryption industry news on July 25
Knowledge points of C language documents
Detailed explanation of redis's single login
数据查询函数