el-select在ios中使用出现的问题

1、el-select下拉框里面的内容需要点击两次才能被选中

问题:iOS悬停状态管理有问题

解决方式:将下面样式放在index.htm里面,一定要在这里,因为el-select下拉框是和id="app"平级的,放在app.vue里以及公共样式里可能不生效

<style>
  /* 
  ios悬停状态有问题,造成el-select下拉框需要点击两次才能选中----解决此问题
   */
.el-scrollbar__bar {
  /* background: #000 !important; */
    opacity: 1!important;
}
</style>

2、el-select有filterable属性,能搜索的时候在ios点击不会调起ios软键盘

问题:下拉框里input 有readonly属性

解决方法:去掉readonly属性,在main.js里加入代码

Vue.mixin({
  mounted () {
    if (typeof this.$el.className === 'string') {
      if (this.$el.className.split(' ').indexOf('el-select') !== -1) {
        if (!this.$el.children[0] || !this.$el.children[0].children[0]) {
          return false
        }
//找到input
        this.$el.children[0].children[0].removeAttribute('readOnly')
        this.$el.children[0].children[0].onblur = function () {
          let _this = this
          setTimeout(() => {
            _this.removeAttribute('readOnly')
          }, 200)
        }
      }
    }
  }
})
Vue.use(ElementUI)

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值