关于前端:eldatepicker日期和时间范围无法选择时间的问题

问题景象

起因

起因验证:在chrome调试台获取该input元素,执行input.focus(),而后点击input框呈现下拉列表

尝试

  • 在我的项目中,用DOM操作获取该input元素,而后input.focus() 有效
  • 将dialog和popover增加到body上 有效

解决办法

  • 给该el-date-picker增加属性 :teleported="false" popper-class="need-focus-input"
  • 定义类

    <style lang="scss">
    .need-focus-input{
      position: fixed !important;
      left: 570px !important;  //定位按本人我的项目地位需要来
      top: 252px !important;   //定位按本人我的项目地位需要来
      margin: 0px !important;
      .el-popper__arrow{
      top:407px !important;
      }
    }
    </style>

    留神:因为下拉框没有增加在body上,所以不能在style scoped中定义该类

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理