<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.

el-table 列表里包含输入框,输入值是出现卡顿问题,可以把输入框单独提取出来_vue.js