浏览代码

Fix raw list not working in foreach (#547)

Thomas Brandého 2 年之前
父节点
当前提交
d0b47e1c23
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      pynecone/components/layout/foreach.py

+ 1 - 0
pynecone/components/layout/foreach.py

@@ -36,6 +36,7 @@ class Foreach(Component):
             type_ = iterable.type_.__args__[0]
         except Exception:
             type_ = Any
+        iterable = Var.create(iterable)  # type: ignore
         if iterable.type_ == Any:
             raise TypeError(
                 f"Could not foreach over var of type Any. (If you are trying to foreach over a state var, add a type annotation to the var.)"