add initial AddSectionDialog

This commit is contained in:
Seth Ladygo
2019-05-17 14:30:58 -07:00
parent b8e09b21c5
commit 109ca15c4b
2 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,68 @@
<template>
<div class="text-xs-center">
<v-dialog v-model="show" width="300">
<v-form v-model="valid">
<v-card>
<DialogHeading title="Add Section">
<v-btn icon @click="show = false" class="ma-0 pa-0">
<v-icon color="white">clear</v-icon>
</v-btn>
</DialogHeading>
<v-card-text>
<v-text-field
:rules="[v => !!v || 'Required']"
v-model="name"
label="Name"
autofocus
required>
</v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn flat @click="show = false">Cancel</v-btn>
<v-btn
:disabled="!valid"
color="primary"
flat
@click="show = false">OK</v-btn>
<v-spacer></v-spacer>
</v-card-actions>
</v-card>
</v-form>
</v-dialog>
</div>
</template>
<script>
import DialogHeading from './DialogHeading'
// https://stackoverflow.com/questions/48035310/open-a-vuetify-dialog-from-a-component-template-in-vuejs
export default {
components: {
DialogHeading,
},
data: () => ({
name: '',
valid: false,
}),
props: {
value: Boolean,
},
computed: {
show: {
get() {
return this.value
},
set(value) {
this.$emit('input', value)
}
},
}
}
</script>
<style>
</style>

View File

@ -130,6 +130,7 @@
</v-layout>
<AddProductDialog v-model="showAddProductDialog"/>
<AddSectionDialog v-model="showAddSectionDialog"/>
</v-container>
</template>
@ -142,16 +143,19 @@ import arrayMove from 'array-move'
import { paginateModels } from '@/pagination'
import DragListHeading from './DragListHeading'
import AddProductDialog from './AddProductDialog'
import AddSectionDialog from './AddSectionDialog'
export default {
components: {
DragListHeading,
AddProductDialog,
AddSectionDialog,
//RawDisplayer,
},
data: () => ({
showAddProductDialog: false,
showAddSectionDialog: true,
}),
computed: {
...mapState([