我想在组合框的左侧添加标签。我也很好奇为什么我需要在样式中添加 !important 以使其覆盖 .root 样式。
<ComboBox
label='AUDIT Month'
id='AuditMonth'
options={this._getMonths()}
styles={
{
label:{display:'inline-block !important'},
input:{display:'inline-block !important'},
}
}
defaultSelectedKey=''
allowFreeform={false}
autoComplete='on'
/>
上面仍然保留 .root 样式,并且没有将标签放在我想要的位置。
<ComboBox
label='AUDIT Month'
id='AuditMonth'
options={this._getMonths()}
styles={
{
label:{color:'fuchsia'},
}
}
defaultSelectedKey=''
allowFreeform={false}
autoComplete='on'
/>
除非我添加 !important ,否则这是行不通的,我不想这样做。
谢谢你的帮助。