fish 6 months ago
parent
commit
1531be3b0c

+ 36 - 0
test_streamlit_antd_components/app.py

@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+'''
+@Contact :   liuyuqi.gov@msn.cn
+@Time    :   2024/10/06 17:41:46
+@License :   Copyright © 2017-2022 liuyuqi. All Rights Reserved.
+@Desc    :   Streamlit 应用中集成 Ant Design 组件
+'''
+
+import streamlit as st
+import streamlit_antd_components as sac
+
+st.set_page_config(
+    page_title="Ant Design",
+    page_icon="👋",
+    layout="wide",
+    initial_sidebar_state="expanded",
+    menu_items={
+        "Report a bug": "https://github.com/streamlit/streamlit/issues/new/choose",
+        "Get help": "https://discuss.streamlit.io/"
+    }
+)
+
+# 三个按钮
+btn = sac.buttons(
+    items=['button1', 'button23', 'button3'],
+    index=0,
+    format_func='title',
+    align='center',
+    direction='horizontal',
+    radius='lg',
+    return_index=False,
+)
+st.write(f'The selected button label is: {btn}')
+
+

+ 16 - 0
test_streamlit_antd_components/pyproject.toml

@@ -0,0 +1,16 @@
+[tool.poetry]
+name = "test_streamlit-antd-components"
+version = "0.1.0"
+description = ""
+authors = ["fish <zz1036@qq.com>"]
+readme = "README.md"
+
+[tool.poetry.dependencies]
+python = "^3.12"
+streamlit = "^1.39.0"
+streamlit-antd-components = "^0.3.2"
+
+
+[build-system]
+requires = ["poetry-core"]
+build-backend = "poetry.core.masonry.api"