Focus on the folder input. submit form via vuejs on submit event

parent 539c3b4d
......@@ -11,9 +11,9 @@
</el-button>
<el-dialog title="New Folder" :visible.sync="dialogFormVisible" size="tiny">
<el-form :model="folder" v-loading.body="loading">
<el-form :model="folder" v-loading.body="loading" @submit.native.prevent="onSubmit()">
<el-form-item label="Folder name" :class="{'el-form-item is-error': form.errors.has('name') }">
<el-input v-model="folder.name" auto-complete="off"></el-input>
<el-input v-model="folder.name" auto-complete="off" autofocus></el-input>
<div class="el-form-item__error" v-if="form.errors.has('name')"
v-text="form.errors.first('name')"></div>
</el-form-item>
......
......@@ -94237,6 +94237,12 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
}],
attrs: {
"model": _vm.folder
},
nativeOn: {
"submit": function($event) {
$event.preventDefault();
_vm.onSubmit()
}
}
}, [_c('el-form-item', {
class: {
......@@ -94247,7 +94253,8 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
}
}, [_c('el-input', {
attrs: {
"auto-complete": "off"
"auto-complete": "off",
"autofocus": ""
},
model: {
value: (_vm.folder.name),
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment