antdesignvue a-input-number默认聚焦并选中文本框内容

<a-input-number
   ref="sxInput"
   size="middle"
   style="width: 200px"
   v-model:value="inputValue"
   @focus="onFocus"
 />
export default {
	setup() {
		const sxInput = ref()
		onMounted(() => {
		   nextTick(() => {
		     sxInput.value.focus()
		   })
		 })
		const onFocus = e => {
	      e.target.select()
	    }
    }
}

你可能感兴趣的:(vue.js,前端)