"add section" works
This commit is contained in:
@ -26,7 +26,7 @@
|
|||||||
:disabled="!valid"
|
:disabled="!valid"
|
||||||
color="primary"
|
color="primary"
|
||||||
flat
|
flat
|
||||||
@click="show = false">OK</v-btn>
|
@click="doNewSection()">OK</v-btn>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
@ -37,8 +37,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import DialogHeading from './DialogHeading'
|
import DialogHeading from './DialogHeading'
|
||||||
|
import { mapActions } from 'vuex'
|
||||||
|
|
||||||
// https://stackoverflow.com/questions/48035310/open-a-vuetify-dialog-from-a-component-template-in-vuejs
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
DialogHeading,
|
DialogHeading,
|
||||||
@ -59,7 +59,19 @@ export default {
|
|||||||
this.$emit('input', value)
|
this.$emit('input', value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions([
|
||||||
|
'newSection',
|
||||||
|
]),
|
||||||
|
doNewSection() {
|
||||||
|
if (this.name) {
|
||||||
|
this.newSection(this.name)
|
||||||
|
}
|
||||||
|
this.name = ''
|
||||||
|
this.show = false
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -284,6 +284,15 @@ export const store = new Vuex.Store({
|
|||||||
// manipulation
|
// manipulation
|
||||||
//
|
//
|
||||||
|
|
||||||
|
newSection({ commit, getters }, name) {
|
||||||
|
let section = {
|
||||||
|
name: name,
|
||||||
|
id: getters.nextSectionID,
|
||||||
|
pages: [],
|
||||||
|
}
|
||||||
|
commit('addSection', section)
|
||||||
|
},
|
||||||
|
|
||||||
reorderSection({ commit }, payload) {
|
reorderSection({ commit }, payload) {
|
||||||
commit('reorderSection', payload)
|
commit('reorderSection', payload)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user