奥非域

el-select苹果ios无法激活软键盘问题

el-select设置allow-create允许用户输入时,在ios下不能正常激活软键盘,这是readonly属性异常导致的,暂时的解决方法是新建一个js文件,在main.js中引用,内容如下:

import ElementUi from 'element-ui';

// Fixes an issue with filters not working on mobile
ElementUi.Select.computed.readonly = function () {
    // trade-off for IE input readonly problem: https://github.com/ElemeFE/element/issues/10403
    const isIE = !this.$isServer && !Number.isNaN(Number(document.documentMode));

    return !(this.filterable || this.multiple || !isIE) && !this.visible;
};

export default ElementUi;

Vue