关于页面跳转多参数传递的问题?

小程序 文章 2022-04-14 09:40 546 0 全屏看文

AI助手支持GPT4.0

关于页面跳转多参数传递的问题?Questions about passing multiple parameters to page jumps?

关于页面跳转多参数传递的问题?

进行单个参数传递的时候,A页面传ID至B页面,B页面可以调用该数据操作数据库。

但是进行多个参数传递的时候,A页面传ID至B页面,如果ID作为第一参数依然可以操作数据库,但是作为第二参数则无法调用数据库(console.log可以打印出来)。

网上找了很多,但依然没有解决,求帮助

A页面:

B页面


结果


When passing a single parameter, page a passes the ID to page B, and page B can call the data to operate the database. However, when multiple parameters are passed, page a passes the ID to page B. if the ID is used as the first parameter, the database can still be operated, but as the second parameter, the database cannot be called (console.log can be printed). I found a lot on the Internet, but it still hasn't been solved. Ask for help. Page A: page B results

回答:

张老师:

可以尝试使用缓存。把参数存到缓存后跳转页面,在跳转到的页面中读取缓存,再清除这个缓存即可。

brave:

打印下options,是不是参数过长被截取了

是闵by:


this.setData({  id: options.id}, () => {  console.log(this.data.id)})
Weichat:

那就只传一个参数,把title,id,idx数据拼接起来,传递过去后再拆开

八九:

你把下图这一坨放在this.seData回调里试试

-EOF-

AI助手支持GPT4.0