我正在尝试使用python框架创建一个web应用程序。当我尝试使用普通HTML或dcc (破折号核心组件)时,pywebview能够加载内容。但是如果我在UI中使用了破折号引导组件,pywebview就会显示空页面。我已经附上了示例代码来复制这个问题。我不知道为什么dbc (破折号引导元素)没有在pywebview中加载。
生成此问题的示例代码:
""" Importing dependencies """
from threading import Thread
import webview
from dash import dcc, html
import dash
import dash_bootstrap_components as dbc
app = dash.Dash(name, external_stylesheets=[dbc.themes.BOOTSTRAP])
layout = dbc.Button("Test")
""" Issue : The above button is not visible in the pywebview window; But it is available in the browser """
app.layout = html.Div([layout])
if name == "main":
def run_app():
app.run_server(debug=False)
t = Thread(target=run_app)
t.daemon = True
t.start()
""" Start the desktop application """
window = webview.create_window("PDMAT", "http://127.0.0.1:8050/")
webview.start(debug=True)因此,理想情况下,我希望也在pywebview窗口中加载dbc(破折号引导组件)。谢谢。
发布于 2022-01-04 06:39:33
问题是pywebview使用gui作为"edgehtml“而不是"edgechromium”。用GUI作为"edgechrmoium“,它工作得很好。但是"edgechrmoium“将Microsoft 2运行时作为依赖项。因此,请确保您已经在管理模式下安装了"Microsoft 2运行时“,以便将其注册到PC & python使用此PC注册表。
https://stackoverflow.com/questions/70462234
复制相似问题