Home > Web Front-end > uni-app > body text

What to do if uniapp jump is invalid

coldplay.xixi
Release: 2020-12-17 10:22:46
Original
10781 people have browsed it

Solution to invalid uniapp jump: If the path to jump is in the tabBar in pages.json, you need to use [uni.switchTab] to jump, the code is [let page = getCurrentPages().pop ();].

What to do if uniapp jump is invalid

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version. This method is suitable for all brands of computers.

Recommended (free): uni-app development tutorial

Solution to invalid uniapp jump:

In a In the interface, uni.navigateTo is used to jump, but the jump does not respond.

this.$request(this.$api['xxxx/xxxxxx'], this.journeyMessage, res =>{  
                        uni.navigateTo({
                            url: '/pages/journey/journeyList'
                        });
                        console.log('11111111111111') 
                    })
Copy after login

is debugged and found that the code is executed, but has no effect.

Finally refer to the online boss Found:

If the path to jump is in the tabBar in pages.json, you need to use uni.switchTab to jump

But use uni.switchTab to jump The transfer will not refresh,

              uni.switchTab({ 
                            url:'',
                            success:(res)=> { 
                                 let page = getCurrentPages().pop();  //跳转页面成功之后
                                 if (!page) return;   
                                 page.loadData(); //如果页面存在,则重新刷新页面
                              }
                        });
Copy after login

Related free learning recommendations: php programming (video)

The above is the detailed content of What to do if uniapp jump is invalid. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template