1. 程式人生 > >element 中點選table中的某一行,使對應行中的Input獲取焦點

element 中點選table中的某一行,使對應行中的Input獲取焦點

css中使inputh獲取焦點的方法是: autofocus='true'

在專案中點選table表格中的行,使input獲取焦點

element中table點選行的事件 @row-click="clickInput"
methods: {
clickInput(row, event, column) {
    if (column.label === '能力打分') { // 行中對應的某一個cell
        this.$nextTick(() => {
          event.target.children[0].focus()
        })
      }
    },
}