<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>
参考链接
https://blog.csdn.net/m0_56065511/article/details/126300190
人工智能学习网站