This commit is contained in:
2019-11-08 21:37:56 +00:00
parent 4bc52914f4
commit e7e0c94c16
3 changed files with 59 additions and 32 deletions

View File

@@ -28,26 +28,33 @@
:max-width="options.width"
@keydown.esc="cancel"
>
<v-card>
<v-card elevation="24">
<v-card-title
v-if="options.title"
class="headline lighten-2"
v-bind:class="options.type"
primary-title
>
{{ title }}
{{ options.title }}
</v-card-title>
<v-card-text>
{{ message }}
{{ options.message }}
</v-card-text>
<v-divider></v-divider>
<!-- <v-divider></v-divider> v-bind:class="options.type" -->
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" text @click="isVisible = false">
I accept
</v-btn>
<v-btn
v-if="options.noButtonText"
color="primary darken-1"
text
@click.native="cancel"
>{{ options.noButtonText }}</v-btn
>
<v-btn color="primary darken-1" text @click.native="agree">{{
options.yesButtonText
}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
@@ -87,20 +94,20 @@ export default {
isVisible: false,
resolve: null,
reject: null,
message: null,
title: null,
options: {
title: null,
message: null,
yesButtonText: null,
noButtonText: null,
type: "warning", //one of success, info, warning, and error, see v-alert docs for more info
width: 290,
zIndex: 200
}
}),
methods: {
open(title, message, options) {
this.isVisible = true;
this.title = title;
this.message = message;
open(options) {
this.options = Object.assign(this.options, options);
this.isVisible = true;
return new Promise((resolve, reject) => {
this.resolve = resolve;
this.reject = reject;