二元运算放在class里不正确,
应该怎么写才正确
(item.is_supported != 0)? text-danger : item.support_count;
html+= '' + [i] + '
';
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
分开来写,不容易出错
把
item.support_count后面那个分号删掉。分号不是
? :运算符的一部分。分号的意思是结束一个语句。