Save List on enter
This commit is contained in:
parent
eca23d5916
commit
4cb7fa3a43
@ -7,7 +7,7 @@
|
||||
<label class="label">Name
|
||||
</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" v-model="name">
|
||||
<input class="input" type="text" v-model="name" v-on:keyup="createIfEnter">
|
||||
</div>
|
||||
</div>
|
||||
<button class="button is-primary" v-if="item === null" v-on:click="createItem">Create new list</button>
|
||||
@ -31,6 +31,11 @@ export default {
|
||||
toggleModal: function () {
|
||||
this.$emit('toggleModal')
|
||||
},
|
||||
createIfEnter: function (e) {
|
||||
if (e.key === 'Enter') {
|
||||
this.createItem();
|
||||
}
|
||||
},
|
||||
createItem: function () {
|
||||
fetch(`${process.env.VUE_APP_API_BASE_URL}/api/lists`, {
|
||||
method: 'POST',
|
||||
|
Loading…
Reference in New Issue
Block a user