vuejs2 - Vue-material Dialog : Close Dialog -
i'm using vue-material dialog show form, i've :
leftsidenav.vue - template :
<md-button class="list-button" id="formbtn" @click="openformdialog()"> <md-icon>description</md-icon> <span class="sidenav-item-text">{{$t('form_dialog')}}</span> <md-tooltip md-delay="100" md-direction="right">{{$t('form_dialog'')}}</md-tooltip> </md-button> <md-dialog md-open-from="#formbtn" ref="formdialog"> <md-dialog-title>title</md-dialog-title> <md-dialog-content> <form-dialog></form-dialog> </md-dialog-content> </md-dialog>
leftsidenav.vue - script :
methods: { openformdialog() { this.$refs.formdialog.open(); }, closeformdialog() { this.$refs.formdialog.close(); }, },
formdialog.vue :
<template> <div> test <div class="buttons"> <md-button class="md-raised" @click="closeformdialog">cancel</md-button> <md-button class="md-raised">submit</md-button> </div> </div> </template>
the problem in formdialog don't know how access closeformdialog method, how can close dialog clicking cancel button on formdialog.vue ?
Comments
Post a Comment