mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
feat: 页面增加radio自动通过预设值设置,避免复杂的php或js渲染判断
This commit is contained in:
@@ -1885,6 +1885,9 @@
|
||||
// 监听下拉选择生成
|
||||
admin.api.select();
|
||||
|
||||
// 监听原生单选框选中
|
||||
admin.api.nativeRadio();
|
||||
|
||||
// 监听时间控件生成
|
||||
admin.api.date();
|
||||
|
||||
@@ -2707,6 +2710,17 @@
|
||||
);
|
||||
});
|
||||
},
|
||||
nativeRadio() {
|
||||
$('[value-checked]').each(function (index, elem) {
|
||||
if ($(this).hasClass('checked-rendered')) {
|
||||
return;
|
||||
}
|
||||
$(this).addClass('checked-rendered');
|
||||
if ($(this).attr('value') == $(this).attr('value-checked')) {
|
||||
$(this).prop('checked', true);
|
||||
}
|
||||
});
|
||||
},
|
||||
date: function () {
|
||||
var dateList = document.querySelectorAll("[data-date]");
|
||||
if (dateList.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user