go_app是否可以携带参数 #242
Answered
by
wang0618
Zhaoyuhang97
asked this question in
Q&A
go_app是否可以携带参数
#242
|
大佬你好, 我有一张员工列表,当中维护的是个人的详细信息,我通过按钮跳转新开一个页面显示详细信息,我把新页面放在start_server中的application中,然后用go_app进行跳转,但是跳转的新页面没有办法接收员工号,请问是否有方法可以让go_app中跳转的目标函数接受传参,或者有其他办法可以实现这个功能? 目前是使用全局变量传的,但是这样总感觉不太方便 |
Answered by
wang0618
Dec 20, 2021
Replies: 3 comments 4 replies
|
可以自己手工拼接参数,然后使用 参见: https://pywebio.readthedocs.io/zh_CN/latest/cookbook.html#get-url-parameters-of-current-page |
1 reply
Answer selected by
Zhaoyuhang97
|
之后会考虑加入传参功能 |
2 replies
|
大佬原生传参支持还是没有吗 |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
可以自己手工拼接参数,然后使用
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