瀏覽代碼

fix "constant" ID for auto-index page example

Falko Schindler 2 年之前
父節點
當前提交
a4256953d6
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      website/reference.py

+ 7 - 1
website/reference.py

@@ -1,9 +1,12 @@
+import uuid
 from typing import Dict
 from typing import Dict
 
 
 from nicegui import ui
 from nicegui import ui
 
 
 from .example import example
 from .example import example
 
 
+CONSTANT_UUID = str(uuid.uuid4())
+
 
 
 def create_intro() -> None:
 def create_intro() -> None:
     @example('''#### Styling
     @example('''#### Styling
@@ -624,7 +627,10 @@ In the example to the right, the displayed ID on the auto-index page remains con
         async def private_page():
         async def private_page():
             ui.label(f'private page with ID {uuid4()}')
             ui.label(f'private page with ID {uuid4()}')
 
 
-        ui.label(f'shared auto-index page with ID {uuid4()}')
+        # ui.label(f'shared auto-index page with ID {uuid4()}')
+        # ui.link('private page', private_page)
+        # END OF EXAMPLE
+        ui.label(f'shared auto-index page with ID {CONSTANT_UUID}')
         ui.link('private page', private_page)
         ui.link('private page', private_page)
 
 
     @example('''#### Pages with Path Parameters
     @example('''#### Pages with Path Parameters