]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🌐 Update Chinese translation for `docs/zh/docs/tutorial/query-params.md` (#11242)
authorJackLee <280147597@qq.com>
Sat, 9 Mar 2024 00:32:05 +0000 (08:32 +0800)
committerGitHub <noreply@github.com>
Sat, 9 Mar 2024 00:32:05 +0000 (01:32 +0100)
docs/zh/docs/tutorial/query-params.md

index b1668a2d2523f495f21bc6aba3d0b0ef59932a27..a0cc7fea393105aea62d7f7c21e5cde33eaa61ea 100644 (file)
@@ -63,9 +63,18 @@ http://127.0.0.1:8000/items/?skip=20
 
 通过同样的方式,你可以将它们的默认值设置为 `None` 来声明可选查询参数:
 
-```Python hl_lines="7"
-{!../../../docs_src/query_params/tutorial002.py!}
-```
+=== "Python 3.10+"
+
+    ```Python hl_lines="7"
+    {!> ../../../docs_src/query_params/tutorial002_py310.py!}
+    ```
+
+=== "Python 3.8+"
+
+    ```Python hl_lines="9"
+    {!> ../../../docs_src/query_params/tutorial002.py!}
+    ```
+
 
 在这个例子中,函数参数 `q` 将是可选的,并且默认值为 `None`。