Home  >  Article  >  Web Front-end  >  What to do if uniapp jump is invalid

What to do if uniapp jump is invalid

coldplay.xixi
coldplay.xixiOriginal
2020-12-16 16:47:3610779browse

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') 
                    })

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(); //如果页面存在,则重新刷新页面
                              }
                        });

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!

Statement:
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
Previous article:Can uniapp use vuex?Next article:Can uniapp use vuex?