custom event "confirm"

This commit is contained in:
Jörn-Michael Miehe 2019-05-07 22:14:23 +02:00
parent 3a0e889626
commit 655f64c193
3 changed files with 6 additions and 6 deletions

View file

@ -22,7 +22,7 @@
{{ buttonText }} {{ buttonText }}
</v-btn> </v-btn>
<v-btn color="error" @click="dialog = false"> <v-btn color="error" @click.native="dialog = false">
Cancel Cancel
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
@ -46,7 +46,7 @@ export default {
methods: { methods: {
validate() { validate() {
if (this.$refs.form.validate()) { if (this.$refs.form.validate()) {
this.$parent.confirm() this.$emit('confirm')
} }
} }
}, },

View file

@ -1,5 +1,5 @@
<template> <template>
<FormDialog buttonText="Login"> <FormDialog buttonText="Login" @confirm="doLogin">
<v-card-title class="headline"> <v-card-title class="headline">
Log In Log In
</v-card-title> </v-card-title>
@ -43,7 +43,7 @@ export default {
}), }),
methods: { methods: {
confirm() { doLogin() {
axios axios
.post('/user/login', { .post('/user/login', {
session: Cookies.get('session'), session: Cookies.get('session'),

View file

@ -1,5 +1,5 @@
<template> <template>
<FormDialog buttonText="Register"> <FormDialog buttonText="Register" @confirm="doRegister">
<v-card-title class="headline"> <v-card-title class="headline">
Register Register
</v-card-title> </v-card-title>
@ -67,7 +67,7 @@ export default {
}, },
methods: { methods: {
confirm() { doRegister() {
axios axios
.post('/user/register', { .post('/user/register', {
session: null, session: null,