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

parent 539c3b4d
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
</el-button> </el-button>
<el-dialog title="New Folder" :visible.sync="dialogFormVisible" size="tiny"> <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-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')" <div class="el-form-item__error" v-if="form.errors.has('name')"
v-text="form.errors.first('name')"></div> v-text="form.errors.first('name')"></div>
</el-form-item> </el-form-item>
......
...@@ -94237,6 +94237,12 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c ...@@ -94237,6 +94237,12 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
}], }],
attrs: { attrs: {
"model": _vm.folder "model": _vm.folder
},
nativeOn: {
"submit": function($event) {
$event.preventDefault();
_vm.onSubmit()
}
} }
}, [_c('el-form-item', { }, [_c('el-form-item', {
class: { class: {
...@@ -94247,7 +94253,8 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c ...@@ -94247,7 +94253,8 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
} }
}, [_c('el-input', { }, [_c('el-input', {
attrs: { attrs: {
"auto-complete": "off" "auto-complete": "off",
"autofocus": ""
}, },
model: { model: {
value: (_vm.folder.name), 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