feat: 增加select的选中处理

This commit is contained in:
augushong
2025-05-07 17:51:17 +08:00
parent f403b86583
commit ec047ce3b7

View File

@@ -1969,6 +1969,7 @@
// 监听原生单选框选中
admin.api.nativeRadio();
admin.api.nativeSelect();
// 监听时间控件生成
admin.api.date();
@@ -2841,6 +2842,17 @@
}
});
},
nativeSelect() {
$('[value-selected]').each(function (index, elem) {
if ($(this).hasClass('selected-rendered')) {
return;
}
$(this).addClass('selected-rendered');
if ($(this).attr('value') == $(this).attr('value-selected')) {
$(this).prop('selected', true);
}
});
},
date: function () {
var dateList = document.querySelectorAll("[data-date]");
if (dateList.length > 0) {