【问题标题】:buttons vs checkboxes behaviour in ipyvuetify different. Why?ipyvuetify 中的按钮与复选框的行为不同。为什么?
【发布时间】:2021-04-08 15:53:02
【问题描述】:

我正在安排一些ipyvuetify组件如下:

import ipyvuetify as vue
vue.Col(children=[vue.Checkbox(label='A'),vue.Checkbox(label='C'),vue.Checkbox(label='D')])
#and 
vue.Col(children=[vue.Btn(label='A', children=['A']),vue.Btn(label='CS', children=['C']),vue.Btn(label='D', children=['D'])])

出现如下:

如果两者都是列 (vue.Col) 并且只有复选框实际出现在列中,为什么会这样?

谢谢

【问题讨论】:

    标签: python ipywidgets ipyvuetify


    【解决方案1】:

    按钮是inline elements, not blocks。如果您指定这些按钮应表现为 HTML 块,则它们也显示为列:

    vue.Col(
        children = [
            vue.Btn(
                block=True,
                label='A',
                children=['A']
            ),
            vue.Btn(
                block=True,
                label='CS',
                children=['C']
            ),
            vue.Btn(
                block=True,
                label='D',
                children=['D']
            )
        ]
    )
    

    【讨论】:

      猜你喜欢
      • 2014-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-19
      • 2014-12-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多