el-date-picker获取焦点

46 阅读1分钟
  • el-time-piker:

` const timepikerRef = ref();

timepikerRef.value.focus(true);

// 或 import { getCurrentInstance, nextTick } from 'vue'

const { proxy } = getCurrentInstance()

// proxy.$refs.timepikerRef?.focus(true)

proxy.refs[refs[`{row.name}Ref`].focus(true) // ${row.name}=’timepiker‘

`