traxxx/assets/components/stashes/add.vue

54 lines
735 B
Vue
Raw Normal View History

2021-03-20 02:22:08 +00:00
<template>
<Dialog
title="Add stash"
@close="$emit('close', false)"
2021-03-20 02:22:08 +00:00
>
2021-04-04 22:48:03 +00:00
<form
class="dialog-body"
@submit.prevent="addStash"
>
2021-03-20 02:22:08 +00:00
<input
ref="name"
v-model="name"
type="input"
placeholder="Name"
class="input"
>
<div class="dialog-actions right">
<button
type="submit"
class="button button-primary"
>Add</button>
</div>
</form>
</Dialog>
</template>
<script>
async function addStash() {
await this.$store.dispatch('createStash', {
name: this.name,
});
this.$emit('close', true);
2021-03-20 02:22:08 +00:00
}
function mounted() {
this.$refs.name.focus();
}
export default {
data() {
return {
name: null,
};
},
emits: ['close'],
2021-03-20 02:22:08 +00:00
mounted,
methods: {
addStash,
},
};
</script>