自定義局部指令
directives: {
focus: {
// 指令的定義
inserted: function(el) {
el.children[0].focus();
// el.querySelector("input").focus();
}
}
},
<el-input
ref="input"
v-focus
v-model="row.newName"
class="red-star"
></el-input>