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)