inputref专题

vue3---inputRef.value.focus()报错Cannot read properties of null (reading ‘focus‘)

问题描述:点击编辑按钮,出现el-input框(el-input显示隐藏通过v-if控制)    <el-input ref="inputRef" v-if="isEdit" v-model="modelName" @blur="isEdit = false" /><el-button text class="btn-wrapper" v-show="!isEdit"><svg-icon