代码优化:if..esle判断冗长
This commit is contained in:
parent
469f1d9f01
commit
f61a3850ff
@ -87,16 +87,8 @@ layui.define('jquery',function(exports){
|
|||||||
+ (i>Math.floor(options.value)?ICON_RATE:ICON_RATE_SOLID)
|
+ (i>Math.floor(options.value)?ICON_RATE:ICON_RATE_SOLID)
|
||||||
+ '" '+ style +'></i></li>';
|
+ '" '+ style +'></i></li>';
|
||||||
|
|
||||||
if(options.half){
|
if(options.half&&parseInt(options.value) !== options.value&&i == Math.ceil(options.value)){
|
||||||
if(parseInt(options.value) !== options.value){
|
temp = temp + '<li><i class="layui-icon layui-icon-rate-half" '+ style +'></i></li>';
|
||||||
if(i == Math.ceil(options.value)){
|
|
||||||
temp = temp + '<li><i class="layui-icon layui-icon-rate-half" '+ style +'></i></li>';
|
|
||||||
}else{
|
|
||||||
temp = temp + item
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
temp = temp + item
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
temp = temp +item;
|
temp = temp +item;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user