如何更改用户的字体颜色和样式,如下图所示?我希望它像右侧的白色字体一样。这是我的代码
{
text: 'Users',
iconCls: 'user',
menu: {
xtype: 'menu',
bodyStyle:'background-color:white !important;',
plain: true,
items: {
xtype: 'buttongroup',
columns: 1,
defaults: {
xtype: 'button',
scale: 'large',
iconAlign: 'left'
},
items: [
{
text: 'Settings',
width: 130
},{
text: 'Notifications',
width: 130
},{
text: 'Log Out',
width: 130
}]
}
}
},
{
xtype: 'label',
id: 'h_usr',
margin: '0 5 0 5',
hidden: true,
style: {
'color':'white',
'style': 'Helvetica',
'font-size': '15px'
},
html: 'Logged in as <b>admin</b>'
}
最佳答案
只需更新 html 配置属性以包含颜色:
html: 'Logged in as <span style="font-weight: bold; color: green;">admin</span>'
这将使用户名变成绿色等。
关于javascript - 更改xtype菜单extjs的字体颜色和样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21018159/