gpt4 book ai didi

javascript - 更改xtype菜单extjs的字体颜色和样式

转载 作者:行者123 更新时间:2023-11-28 08:36:54 26 4
gpt4 key购买 nike

如何更改用户的字体颜色和样式,如下图所示?我希望它像右侧的白色字体一样。这是我的代码

{
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>'
}

enter image description here

最佳答案

只需更新 html 配置属性以包含颜色:

html: 'Logged in as <span style="font-weight: bold; color: green;">admin</span>'

这将使用户名变成绿色等。

关于javascript - 更改xtype菜单extjs的字体颜色和样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21018159/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com