// 给table 循环的input 点击的时候获取焦点
// 1、给input 设置ref 属性
<el-input
v-else
ref="refInput"
@blur="(scope.row.code = !scope.row.code), changeBlur()"
v-model="scope.row[item.prop]"
:placeholder="'请输入内容' + item.label"
/>
// 1、给input的ref属性在setup中使用? 叫什么我不清楚
const refInput =ref() //记得return 出去
//事件触发 记得引入 nextTick from vue
const aaaa ()=>{
nextTick(()=>{
refInput.value.focus()
})
}
vue 3.0 给input 获取焦点
最新推荐文章于 2024-04-18 10:33:01 发布