| | |
| | | @input="vale"></el-input> --> |
| | | <template slot-scope="{ row, $index }"> |
| | | <el-input type="textarea" autosize size="mini" v-model="row.proResult" :ref="`input-${$index}`" |
| | | @keyup.enter.native="keyInputConfirm($event, $index)" @focus="handleFocus(row)" |
| | | @keydown.enter.native="keyInputConfirm($event, $index)" @focus="handleFocus(row)" |
| | | @blur="handleInputConfirm(row)" @input="vale"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <!-- slot-scope="scope" --> |
| | | <template slot-scope="{ row, $index }"> |
| | | <el-input type="textarea" autosize size="mini" v-model="row.proResult" :ref="`input-${$index}`" |
| | | @keyup.enter.native="keyInputConfirm($event, $index)" @focus="handleFocus(row)" |
| | | @keydown.enter.native="keyInputConfirm($event, $index)" @focus="handleFocus(row)" |
| | | @blur="handleInputConfirm(row)" @input="vale"></el-input> |
| | | |
| | | <!-- <el-input type="textarea" autosize size="mini" v-model="scope.row.proResult" autocomplete="off" :ref="`input-${scope.$index}-${scope.row.proResult}`" |
| | |
| | | keyInputConfirm(event, currentRowIndex) { |
| | | // 阻止默认回车行为,比如提交表单 |
| | | event.preventDefault(); |
| | | event.stopPropagation() |
| | | const nextRowIndex = currentRowIndex + 1; // 计算下一行索引 |
| | | |
| | | // 如果下一行存在,则聚焦该行的输入框 |
| | |
| | | // 处理 ref 可能为数组的情况(如动态渲染) |
| | | const target = Array.isArray(nextInput) ? nextInput[0] : nextInput; |
| | | target.focus(); // 聚焦输入框 |
| | | target.select(); // 可选:选中文本 |
| | | // target.select(); // 可选:选中文本 |
| | | } |
| | | }); |
| | | } |