Falko Schindler hai 1 ano
pai
achega
f7e437a071
Modificáronse 1 ficheiros con 3 adicións e 6 borrados
  1. 3 6
      website/documentation/content/markdown_documentation.py

+ 3 - 6
website/documentation/content/markdown_documentation.py

@@ -56,14 +56,11 @@ def markdown_tables():
 
 
 
 
 @doc.demo('Change Markdown content', '''
 @doc.demo('Change Markdown content', '''
-    You can change the content of a markdown element by changing its `content` property.
+    You can change the content of a Markdown element by setting its `content` property or calling `set_content`.
 ''')
 ''')
-def markdown_tables():
+def markdown_new_content():
     markdown = ui.markdown('Sample content')
     markdown = ui.markdown('Sample content')
-    ui.button('Change Content', on_click=lambda: change_content())
-
-    def change_content():
-        markdown.content = 'This is new content'
+    ui.button('Change Content', on_click=lambda: markdown.set_content('This is new content'))
 
 
 
 
 doc.reference(ui.markdown)
 doc.reference(ui.markdown)