go_app是否可以携带参数 #242
-
大佬你好, 我有一张员工列表,当中维护的是个人的详细信息,我通过按钮跳转新开一个页面显示详细信息,我把新页面放在start_server中的application中,然后用go_app进行跳转,但是跳转的新页面没有办法接收员工号,请问是否有方法可以让go_app中跳转的目标函数接受传参,或者有其他办法可以实现这个功能? 目前是使用全局变量传的,但是这样总感觉不太方便 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
可以自己手工拼接参数,然后使用 参见: https://pywebio.readthedocs.io/zh_CN/latest/cookbook.html#get-url-parameters-of-current-page |
Beta Was this translation helpful? Give feedback.
-
之后会考虑加入传参功能 |
Beta Was this translation helpful? Give feedback.
-
大佬原生传参支持还是没有吗 |
Beta Was this translation helpful? Give feedback.
可以自己手工拼接参数,然后使用
run_js("location.href=url", url='/?app=B&uid=0001')
跳转新页面。在新页面,使用
uid = eval_js("new URLSearchParams(window.location.search).get('uid')")
获取员工号参见: https://pywebio.readthedocs.io/zh_CN/latest/cookbook.html#get-url-parameters-of-current-page