form.val() 赋值 radio 的值为布尔值时无法赋值问题. (#1903)

Co-authored-by: meihangbo <meihangbo@126.com>
This commit is contained in:
meihangbo 2024-05-18 14:24:31 +08:00 committed by GitHub
parent fe05f5f8ab
commit b3f86d206a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -117,7 +117,7 @@ layui.define(['lay', 'layer', 'util'], function(exports){
itemElem[0].checked = value;
} else if(type === 'radio') { // 如果为单选框
itemElem.each(function(){
this.checked = this.value == value;
this.checked = this.value == value + '';
});
} else { // 其它类型的表单
itemElem.val(value);