Object.keys

element from 实现input输入框回车键跳入下一行,自动获取焦点element table 实现input输入框回车键跳入下一行,自动获取焦点

使用动态绑定ref  this.$refs获取的是一个所有id组成的对象。 使用Object.keys(this.$refs) //遍历这个对象,返回的是一个包含所有id组成的一个数组,让当前的index+1获取到下一个input的id. 再根据这个id 使用this.$refs获取到这个input 使用focus <...