登录后复制 <script setup lang="ts"> import { onMounted, ref, nextTick } from "vue"; const props = defineProps(["row"]); const emit = defineEmits(["handleBlur"]); const count = ref(props.row.showOrder); const inputRef = ref(); const handleBlur = (value: any) => { let newValue = { ...props.row }; newValue.showOrder = value.target.value; emit("handleBlur", newValue); }; onMounted(() => { nextTick(() => { inputRef.value?.focus(); //获取input焦点 }) }); </script> <template> <el-input type="number" ref="inputRef" v-model="count" @blur="handleBlur" :step="true ? 10 : 100" /> </template> 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32. 原创作者: xutongbao 转载于: https://blog.51cto.com/xutongbao/11830121