如何解决 Dash Bootstrap No_Gutter 类型错误
How to Resolve Dash Bootstrap No_Gutter Type Error
当我 运行 这段代码时,我收到一条错误消息说“错误:dash_bootstrap_components.Row
组件(版本 1.0.2)收到了一个意外的关键字参数:no_gutters
允许的参数:align, children, className, class_name, id, justify, key, loading_state, style
我想这是因为我使用的破折号 bootstrap 版本。如何修改我的代码以使其工作?
app.layout = dbc.Container([
dbc.Row(
dbc.Col(html.H1("My Dashboard",
className='text-center'),
width=12)
),
dbc.Row([
dbc.Col([
dcc.Dropdown(id='my-dpdn', multi=False, value='A',
options=[{'label':x, 'value':x}
for x in sorted(df['Value'].unique())],
),
dcc.Graph(id='line-fig', figure={})
],# width={'size':5, 'offset':1, 'order':1},
xs=12, sm=12, md=12, lg=5, xl=5
),
dbc.Col([
dcc.Dropdown(id='my-dpdn2', multi=True, value=['B','C'],
options=[{'label':x, 'value':x}
for x in sorted(df['Value'].unique())],
),
dcc.Graph(id='line-fig2', figure={})
], #width={'size':5, 'offset':0, 'order':2},
xs=12, sm=12, md=12, lg=5, xl=5
),
], no_gutters=True, justify='start')
], fluid=True)
从 Dash-bootstrap-components 的 1.0 版开始,Row 组件的 no_gutters
属性已被弃用。您可能正在使用版本 <= 0.13 的代码,请阅读此 migration guide 以了解更改的完整详细信息。
这里有几个选项:
- 阅读该迁移指南将建议在标题 没有 'gutters'
的行下删除间距的新方法
Dropped no_gutters prop. Use gutter modifier classes instead. See the docs for examples.
2- 您可以将 dash-bootstrap-components 库恢复为 0.13(例如 pip install dash-bootstrap-components==0.13
),但不推荐这样做。
你可以切换
no_gutters=True
为了
className="g-0"
当我 运行 这段代码时,我收到一条错误消息说“错误:dash_bootstrap_components.Row
组件(版本 1.0.2)收到了一个意外的关键字参数:no_gutters
允许的参数:align, children, className, class_name, id, justify, key, loading_state, style
我想这是因为我使用的破折号 bootstrap 版本。如何修改我的代码以使其工作?
app.layout = dbc.Container([
dbc.Row(
dbc.Col(html.H1("My Dashboard",
className='text-center'),
width=12)
),
dbc.Row([
dbc.Col([
dcc.Dropdown(id='my-dpdn', multi=False, value='A',
options=[{'label':x, 'value':x}
for x in sorted(df['Value'].unique())],
),
dcc.Graph(id='line-fig', figure={})
],# width={'size':5, 'offset':1, 'order':1},
xs=12, sm=12, md=12, lg=5, xl=5
),
dbc.Col([
dcc.Dropdown(id='my-dpdn2', multi=True, value=['B','C'],
options=[{'label':x, 'value':x}
for x in sorted(df['Value'].unique())],
),
dcc.Graph(id='line-fig2', figure={})
], #width={'size':5, 'offset':0, 'order':2},
xs=12, sm=12, md=12, lg=5, xl=5
),
], no_gutters=True, justify='start')
], fluid=True)
从 Dash-bootstrap-components 的 1.0 版开始,Row 组件的 no_gutters
属性已被弃用。您可能正在使用版本 <= 0.13 的代码,请阅读此 migration guide 以了解更改的完整详细信息。
这里有几个选项:
- 阅读该迁移指南将建议在标题 没有 'gutters' 的行下删除间距的新方法
Dropped no_gutters prop. Use gutter modifier classes instead. See the docs for examples.
2- 您可以将 dash-bootstrap-components 库恢复为 0.13(例如 pip install dash-bootstrap-components==0.13
),但不推荐这样做。
你可以切换
no_gutters=True
为了
className="g-0"