当前位置: 代码迷 >> 综合 >> vue3.0 项目中 el-select ios 无法唤起软键盘解决
  详细解决方案

vue3.0 项目中 el-select ios 无法唤起软键盘解决

热度:101   发布时间:2023-11-18 12:48:00.0

main.js

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
const app = createApp(App)// 给组件每个生命周期,都混入一些公共逻辑
app.mixin({mounted () {if (typeof this.$el.className === 'string') {if (this.$el.className.split(' ').indexOf('el-select') !== -1) {this.$el.children[0].children[0].children[0].removeAttribute('readOnly')this.$el.children[0].children[0].children[0].onblur = function () {let _this = thissetTimeout(() => {_this.removeAttribute('readOnly')}, 200)}}}}
})

  相关解决方案