diff --git a/src/App.vue b/src/App.vue index 386ad8d..60e6855 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@
- +
@@ -39,6 +39,12 @@ export default { }) }, + methods: { + addSession: function (session) { + this.sessions.push(session) + } + }, + computed: { sortedSessions: function () { return _(this.sessions).sortBy(session => session.attributes.title) diff --git a/src/components/SessionForm.vue b/src/components/SessionForm.vue index e19069b..d0b1c45 100644 --- a/src/components/SessionForm.vue +++ b/src/components/SessionForm.vue @@ -86,6 +86,8 @@ export default { this.messages.push(`Session ${title} has been created.`) this.errors = [] + this.$emit('submitted', data.data) + this.form.body = '' this.form.title = '' })