在mui.dtpicker.css的最后加上
/年/
[data-type=“year”] .mui-picker,
[data-type=“year”] .mui-dtpicker-title h5 {
width: 100%;
}
[data-type=“year”] [data-id=“picker-m”],
[data-type=“year”] [data-id=“picker-d”],
[data-type=“year”] [data-id=“picker-h”],
[data-type=“year”] [data-id=“picker-i”],
[data-type=“year”] [data-id=“title-m”],
[data-type=“year”] [data-id=“title-d”],
[data-type=“year”] [data-id=“title-h”],
[data-type=“year”] [data-id=“title-i”] {
display: none;
}
在mui.dtpicker.js中找到
在这个后面加上
case ‘year’:
selected.value = selected.y.value;
selected.text = selected.y.text;
break;
虽然是自己写的,但是这个方法是在网上找的。有啥错误,望各位大佬指出 。
new mui.DtPicker设置只显示年份
最新推荐文章于 2024-08-29 12:59:43 发布