【H5开发】Mint UI框架 Datetime picker 时间控件中只需要年月,隐藏日的选项列
【bug】—— 使用Mint UI框架 Datetime picker 时间控件中只需要年和月的列,隐藏日的选项列
这是想要的效果:只需要年和月,不需要日
但是官方并没有提供对应的配置
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-dYExAyHP-1593533213793)(https://upload-images.jianshu.io/upload_images/16771369-70d266ec07028072.png?imageMogr2/auto-orient/strip|imageView2/2/w/949/format/webp)]
解决: 打开组件的时候,用js把“日”的列隐藏起来,完美解决。
openPicker() { this.$refs
.picker
.open() this.$refs
.picker
.$el
.getElementsByClassName('picker-slot')[2].style
.display
='none' },