您可以提供代码(文本形式)吗? 我可以尝试为你修改你的代码。 我模拟你的场景做了测试,发现无法识别你使用的颜色。我使用的是官方支持的颜色,可以根据状态的值改变背景颜色。 以下是代码供您参考:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if([$Status] =='Not Started' , 'grey', if([$Status] == 'In Progress' ,'#0078d4', 'green'))",
"padding-left": "14px"
}
}
这里有关于颜色的链接供您参考: https://learn.microsoft.com/en-us/sharepoint/dev/design/themes-colors