forked from DebaucheryLibrarian/traxxx
List alerts in profile
This commit is contained in:
53
assets/components/stashes/add.vue
Normal file
53
assets/components/stashes/add.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<Dialog
|
||||
title="Add stash"
|
||||
@close="$emit('close', false)"
|
||||
>
|
||||
<form
|
||||
class="dialog-body"
|
||||
@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,
|
||||
});
|
||||
|
||||
this.$emit('close', true);
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
this.$refs.name.focus();
|
||||
}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
name: null,
|
||||
};
|
||||
},
|
||||
emits: ['close'],
|
||||
mounted,
|
||||
methods: {
|
||||
addStash,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user