Просмотр исходного кода

Accordion allow toggle by default (#69)

Nikhil Rao 2 лет назад
Родитель
Сommit
b9d2e2f05c
2 измененных файлов с 5 добавлено и 5 удалено
  1. 4 4
      pynecone/compiler/utils.py
  2. 1 1
      pynecone/components/disclosure/accordion.py

+ 4 - 4
pynecone/compiler/utils.py

@@ -3,7 +3,7 @@
 from __future__ import annotations
 from __future__ import annotations
 
 
 import json
 import json
-from typing import TYPE_CHECKING, Dict, Set, Type
+from typing import TYPE_CHECKING, Dict, List, Set, Type
 
 
 from pynecone import constants, utils
 from pynecone import constants, utils
 from pynecone.compiler import templates
 from pynecone.compiler import templates
@@ -169,11 +169,11 @@ def compile_render(component: Component) -> str:
     return component.render()
     return component.render()
 
 
 
 
-def create_document_root(stylesheets) -> Component:
+def create_document_root(stylesheets: List[str]) -> Component:
     """Create the document root.
     """Create the document root.
 
 
     Args:
     Args:
-        stylesheets: The stylesheets to include in the document root.
+        stylesheets: The list of stylesheets to include in the document root.
 
 
     Returns:
     Returns:
         The document root.
         The document root.
@@ -204,7 +204,7 @@ def create_theme(style: Style) -> Dict:
     }
     }
 
 
 
 
-def add_meta(page: Component, title, image, description) -> Component:
+def add_meta(page: Component, title: str, image: str, description: str) -> Component:
     """Add metadata to a page.
     """Add metadata to a page.
 
 
     Args:
     Args:

+ 1 - 1
pynecone/components/disclosure/accordion.py

@@ -15,7 +15,7 @@ class Accordion(ChakraComponent):
     allow_multiple: Var[bool]
     allow_multiple: Var[bool]
 
 
     # If true, any expanded accordion item can be collapsed again.
     # If true, any expanded accordion item can be collapsed again.
-    allow_toggle: Var[bool]
+    allow_toggle: Var[bool] = True  # type: ignore
 
 
     # The initial index(es) of the expanded accordion item(s).
     # The initial index(es) of the expanded accordion item(s).
     default_index: Var[Optional[List[int]]]
     default_index: Var[Optional[List[int]]]