反复跳转进入一个小程序A后跳回上个小程序B,直接打开小程序A后发现之前由小程序B传递的参数不丢失?

小程序 文章 2022-01-26 17:20 250 0 全屏看文

AI助手支持GPT4.0

反复跳转进入一个小程序A后跳回上个小程序B,直接打开小程序A后发现之前由小程序B传递的参数不丢失?Repeatedly jumping into a applet A and then jumping back to the previous applet B, and directly opening the applet A and finding that the parameters previously passed by the applet B are not lost?

反复跳转进入一个小程序A后跳回上个小程序B,直接打开小程序A后发现之前由小程序B传递的参数不丢失?

反复跳转进入一个小程序A后跳回上个小程序B,直接打开小程序A后发现之前由小程序B传递的存入缓存的参数还没丢失(使用了缓存清理的方法的,没有起效),这个是怎么回事?

After repeatedly jumping into a small program a, jump back to the previous small program B. after directly opening small program a, it is found that the parameters stored in the cache passed by small program B have not been lost (the cache cleaning method is used, but it doesn't work). What's the matter?

回答:

八九:

怎么设置缓存,怎么清理的

建平:onShow: function(option) 这里面的参数没有清理,但是传递进来的值我进行了缓存,这个我进行了清理。不过关键是option这个值一直存在。与后期的清理应该没有关系
八九:你onshow怎么拿参数
建平:我使用的是uni-app 中App.vue页面里的onshow函数的参数去获取别的微信小程序跳转过来的参数的。
建平:这个实际上不是必现的,有30%左右会出现
efbojv:

是不会丢失的 除非你点击的A小程序右上角的重新进入按钮b的数据就会清除

建平:

就是onShow中的值还存在,不消失。

-EOF-

AI助手支持GPT4.0