當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python Streamlit st.experimental_set_query_params用法及代碼示例

設置瀏覽器 URL 欄中顯示的查詢參數。

函數簽名

st.experimental_set_query_params(**query_params)
參數說明

**query_params (dict)

要設置的查詢參數,作為鍵值對。

示例

將用戶的網絡瀏覽器指向類似“http://localhost:8501/?show_map=True&selected;=asia&selected;=america",您將執行以下操作:

st.experimental_set_query_params(
     show_map=True,
     selected=["asia", "america"],
 )

相關用法


注:本文由純淨天空篩選整理自streamlit.io大神的英文原創作品 st.experimental_set_query_params。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。