Преглед изворни кода

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 nicegui import ui
 
 from .example import example
 
+CONSTANT_UUID = str(uuid.uuid4())
+
 
 def create_intro() -> None:
     @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():
             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)
 
     @example('''#### Pages with Path Parameters