el-select ios 上无法拉起 键盘

el-select 再添加 filterable属性支持输入搜索时,在ios上无法拉起键盘

解决


js

import { reactive, ref, nextTick, onMounted } from 'vue'
const selectRef = ref(null)
const { proxy } = getCurrentInstance() //获取全局

setFocus: (value) => {
    nextTick(() => {
        if (!value) {
            setTimeout(() => {
                viewsOperate.delRead()
            }, 700)
        }
    })
},
    delRead: () => {
        const { selectRef } = proxy.$refs
        console.log(selectRef[0])

        if (selectRef[0]) {
            const input = selectRef[0].$el.querySelector('.el-input__inner') //这里需要打印出dom元素才算正常,如果拿不到使用原生的 document.getElementById
            if (input) {
                console.log(input)
                input.removeAttribute('readonly')
            }
        }
    },

你可能感兴趣的:(ios,javascript,vue3,vue.js,elementui,前端)