This commit is contained in:
2019-11-07 00:18:51 +00:00
parent 7d4f24ecac
commit 94efe2aa7a
4 changed files with 30 additions and 87 deletions

View File

@@ -1,44 +1,13 @@
<template>
<!-- <v-dialog
v-model="dialog"
:max-width="options.width"
:style="{ zIndex: options.zIndex }"
@keydown.esc="cancel"
>
<v-card>
<v-toolbar dark :color="options.color" dense flat>
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title>
</v-toolbar>
<v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text>
<v-card-actions class="pt-0">
<v-spacer></v-spacer>
<v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn>
<v-btn color="grey" text @click.native="cancel">Cancel</v-btn>
</v-card-actions>
</v-card>
</v-dialog> -->
<!-- <v-snackbar
:color="options.color"
:value="snackbar"
:timeout="options.timeout"
>
<v-icon color="white">fa-info-circle</v-icon>
<div>
{{ message }}
</div>
<v-btn icon @click="snackbar = false">
<v-icon color="white">fa-times-circle</v-icon>
</v-btn>
</v-snackbar> -->
<v-snackbar
:value="snackbar"
:color="options.color"
:value="isVisible"
:color="options.type"
:timeout="options.timeout"
>
<v-alert type="info">
<v-alert :type="options.type">
{{ message }}
</v-alert>
<v-btn icon @click="snackbar = false">
<v-btn icon @click="isVisible = false">
<v-icon color="white">fa-times-circle</v-icon>
</v-btn>
</v-snackbar>
@@ -47,17 +16,17 @@
<script>
export default {
data: () => ({
snackbar: false,
isVisible: false,
message: null,
options: {
color: "primary",
type: "info", //one of success, info, warning, and error, see v-alert docs for more info
timeout: 3000
}
}),
methods: {
open(message, options) {
this.snackbar = true;
this.isVisible = true;
this.message = message;
this.options = Object.assign(this.options, options);
}