本文整理匯總了Python中dash_html_components.Li方法的典型用法代碼示例。如果您正苦於以下問題:Python dash_html_components.Li方法的具體用法?Python dash_html_components.Li怎麽用?Python dash_html_components.Li使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dash_html_components
的用法示例。
在下文中一共展示了dash_html_components.Li方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Chapter
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Li [as 別名]
def Chapter(name, href=None, caption=None):
linkComponent = html.A if href.startswith('http') else dcc.Link
return html.Div(className='toc--chapter', children=[
html.Li(
linkComponent(
name,
href=relpath(href),
id=href,
className='toc--chapter-link'
),
),
html.Small(
className='toc--chapter-content',
children=Markdown(caption or ''),
style={
'display': 'block',
'marginTop': '-10px' if caption else ''
}
) if caption else None
])
示例2: build_loc_mode_hover_children
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Li [as 別名]
def build_loc_mode_hover_children(loc_mode):
if loc_mode is None:
return None
loc_mode_cfg = LOC_MODE_INFO[loc_mode]
url, examples, desc = (loc_mode_cfg.get(p) for p in ["url", "examples", "desc"])
body = []
if url is not None:
body.append(
html.Div([html.Span("View", className="mr-3"), loc_mode_cfg["url"]])
)
if examples is not None:
body.append(
html.Ul(
[
html.Li(e, style={"listStyleType": "disc"}, className="mb-3")
for e in loc_mode_cfg["examples"]
],
className="pt-3 mb-0",
)
)
if desc is not None:
body.append(html.Span(desc))
return [
html.I(className="ico-help-outline", style=dict(color="white")),
html.Div(
body,
className="hoverable__content build-code",
style=dict(width="auto", whiteSpace="nowrap", left="-2em", top="auto"),
),
]
示例3: create_contents
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Li [as 別名]
def create_contents(contents):
h = []
for i in contents:
if isinstance(i, list):
h.append(create_contents(i))
else:
h.append(html.Li(i))
return html.Ul(h)