小编Oma*_*nny的帖子

类型 {} 无法分配给类型 CSSProperties 错误

如何将内联 CSS 分配给元素?\n如果我这样写,则会出现错误,错误是:

\n
\n

输入'{背景颜色:字符串;颜色: 字符串; marginRight: 数字;\nborderRadius: 数字; 右边框:数字;borderLeft: 数字;\nborderTop: 数字; 边框底部:字符串 | 错误的; }' 不可分配给\n类型“CSSProperties”。\xc2\xa0\xc2\xa0属性“borderBottom”的类型\n兼容。\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0Type 'string | false' 不可分配给类型\n'string | 数量 | (字符串&{})| 不明确的'。\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0Type 'false' 不可分配给类型 'string | 数量 | (字符串&{})| 不明确的'。

\n
\n
<span style={{backgroundColor:backgroundColor,color:color,marginRight:3,borderRadius:4,borderRight:0,borderLeft:0,borderTop:0,borderBottom: isCurrent && '3px solid #00416d'}}>{Symbol}</span> \n
Run Code Online (Sandbox Code Playgroud)\n

css typescript

19
推荐指数
1
解决办法
4万
查看次数

标签 统计

css ×1

typescript ×1