2021-03-20 02:22:08 +00:00
|
|
|
<template>
|
|
|
|
<Dialog
|
|
|
|
title="Add stash"
|
2021-03-20 02:33:29 +00:00
|
|
|
@close="$emit('close', false)"
|
2021-03-20 02:22:08 +00:00
|
|
|
>
|
|
|
|
<form @submit.prevent="addStash">
|
|
|
|
<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,
|
|
|
|
});
|
|
|
|
|
2021-03-20 02:33:29 +00:00
|
|
|
this.$emit('close', true);
|
2021-03-20 02:22:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function mounted() {
|
|
|
|
this.$refs.name.focus();
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
name: null,
|
|
|
|
};
|
|
|
|
},
|
2021-03-20 02:33:29 +00:00
|
|
|
emits: ['close'],
|
2021-03-20 02:22:08 +00:00
|
|
|
mounted,
|
|
|
|
methods: {
|
|
|
|
addStash,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|