custom event "confirm"
This commit is contained in:
parent
3a0e889626
commit
655f64c193
3 changed files with 6 additions and 6 deletions
|
@ -22,7 +22,7 @@
|
|||
{{ buttonText }}
|
||||
</v-btn>
|
||||
|
||||
<v-btn color="error" @click="dialog = false">
|
||||
<v-btn color="error" @click.native="dialog = false">
|
||||
Cancel
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
|
@ -46,7 +46,7 @@ export default {
|
|||
methods: {
|
||||
validate() {
|
||||
if (this.$refs.form.validate()) {
|
||||
this.$parent.confirm()
|
||||
this.$emit('confirm')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<FormDialog buttonText="Login">
|
||||
<FormDialog buttonText="Login" @confirm="doLogin">
|
||||
<v-card-title class="headline">
|
||||
Log In
|
||||
</v-card-title>
|
||||
|
@ -43,7 +43,7 @@ export default {
|
|||
}),
|
||||
|
||||
methods: {
|
||||
confirm() {
|
||||
doLogin() {
|
||||
axios
|
||||
.post('/user/login', {
|
||||
session: Cookies.get('session'),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<FormDialog buttonText="Register">
|
||||
<FormDialog buttonText="Register" @confirm="doRegister">
|
||||
<v-card-title class="headline">
|
||||
Register
|
||||
</v-card-title>
|
||||
|
@ -67,7 +67,7 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
confirm() {
|
||||
doRegister() {
|
||||
axios
|
||||
.post('/user/register', {
|
||||
session: null,
|
||||
|
|
Reference in a new issue