被禁用的 html 标签,无法响应事件
解决方案1:在父元素上添加事件
- el-input 外添加 div
- 在 div 上添加点击事件
若对事件响应范围限制不严,可以在 el-form-item 上添加点击事件(点击表单标签时也会触发事件),必要时需加上事件修饰符.native
- el-input 添加样式
position: relative; z-index: -1
,在原位置下降一层
(若因其他样式影响,el-input 下降一层后无法显示,则可在 div 上添加position: relative; z-index: 1
让父元素上升一层)
解决方案2:改用 readonly