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

3次阅读

共计 452 个字符,预计需要花费 2 分钟才能阅读完成。

问题景象

起因

起因验证:在 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 中定义该类

正文完
 0