当前位置:网站首页>La redirection de l'applet Wechat ne déclenche pas onload
La redirection de l'applet Wechat ne déclenche pas onload
2022-07-05 06:26:00 【Heerey525】
La situation:
1、DeindexSaut de page(wx.navigateTo)ÀaddPage,Pour la première foisaddPageonLoad,Mais pour la deuxième fois,indexSaut de page(wx.navigateTo)ÀaddPage,Ne pas entreraddPageonLoad;
2、DeaddSaut de page(wx.redirectTo)ÀindexPage,Pas d'entrée.indexPageonLoad
Raisons:
La première fois que vous entrez dans une page,Va entrer dans cette pageonLoad,Mais sauter et sauter,En fait, le routage n'est pas détruit,La pile de routage existe déjà sur cette page,Donc mis en cache,Il n'y aura plus deonLoad
Solutions:
1、InonShowSaisissez les paramètres de routage
onShow: function () {
// Obtient la pile de page de l'applet actuel
let pages = getCurrentPages();
// La page la plus indexée du tableau--Page actuelle
let currentPage = pages[pages.length-1];
// Imprimer la page courante options
console.log(currentPage.options)
}
2、switchTabDesuccessAjouteronLoadMéthodes
wx.switchTab({
url: '../index/index',
success: function(e) {
var page = getCurrentPages().pop();
if (page == undefined || page == null) return;
page.onLoad();
}
})
Références:
Cadre d'applet /Niveau logique /Routage des pages
Utilisation des applets wx.navigateTo Aller à la page ,Dans la pageonloadNe pas exécuter?
Applet Wechat switchTab Nouvelle page après le saut onload Problèmes non déclenchés
边栏推荐
- 将webApp或者H5页面打包成App
- 3.Oracle-控制文件的管理
- ‘mongoexport‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。
- Find the combination number acwing 888 Find the combination number IV
- Leetcode backtracking method
- Knapsack problem acwing 9 Group knapsack problem
- There are three kinds of SQL connections: internal connection, external connection and cross connection
- Dataframe (1): introduction and creation of dataframe
- Leetcode stack related
- JS quickly converts JSON data into URL parameters
猜你喜欢

Install opencv -- CONDA to establish a virtual environment and add the kernel of this environment in jupyter

Chapter 6 relational database theory

Gauss Cancellation acwing 884. Solution d'un système d'équations Xor linéaires par élimination gaussienne

高斯消元 AcWing 884. 高斯消元解异或線性方程組

Find the combination number acwing 888 Find the combination number IV

1.手动创建Oracle数据库

Gaussian elimination acwing 884 Gauss elimination for solving XOR linear equations

ollvm编译出现的问题纪录

栈 AcWing 3302. 表达式求值

confidential! Netease employee data analysis internal training course, white whoring! (attach a data package worth 399 yuan)
随机推荐
3. Oracle control file management
4. 对象映射 - Mapping.Mapster
Find the combination number acwing 889 01 sequence meeting conditions
7.Oracle-表结构
[moviepy] unable to find a solution for exe
How to make water ripple effect? This wave of water ripple effect pulls full of retro feeling
Winter vacation water test 1 Summary
Leetcode heap correlation
Chinese remainder theorem acwing 204 Strange way of expressing integers
FFmpeg build下载(包含old version)
Shutter web hardware keyboard monitoring
Leetcode dynamic programming
[leetcode] day95 effective Sudoku & matrix zeroing
MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
11-gorm-v2-03-basic query
求组合数 AcWing 887. 求组合数 III
LeetCode-61
AE tutorial - path growth animation
Install opencv -- CONDA to establish a virtual environment and add the kernel of this environment in jupyter
__ builtin_ Popcount() counts the number of 1s, which are commonly used in bit operations