From 71877b6a159550c4a4f89288cd025b76de05bf81 Mon Sep 17 00:00:00 2001
From: 135e2 <135e2@135e2.tk>
Date: Sat, 13 Aug 2022 23:07:34 +0800
Subject: chore(snackbar): support snackbar theme

---
 src/App.vue | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index a1960eb..434845a 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -39,7 +39,7 @@
           @click="toggleTheme"
         ></v-list-item> </v-list
     ></v-navigation-drawer>
-    <v-snackbar color="grey" v-model="snackbar">
+    <v-snackbar timeout="3000" :color="snackbarColor" v-model="snackbar">
       {{ snackbarText }}
 
       <template v-slot:actions>
@@ -99,6 +99,7 @@ export default {
     atSettings: false,
     snackbar: false,
     snackbarText: "Default snackbar text (End-user shouldn't see this)",
+    snackbarColor: "black",
     bg: {
       // backgroundColor: "grey",
       backgroundImage: "",
@@ -111,7 +112,7 @@ export default {
 
     return {
       theme,
-      toggleTheme: () =>
+      toggleVuetifyTheme: () =>
         (theme.global.name.value = theme.global.current.value.dark
           ? "light"
           : "dark"),
@@ -132,6 +133,10 @@ export default {
       this.snackbarText = text;
       this.snackbar = true;
     },
+    toggleTheme() {
+      this.toggleVuetifyTheme();
+      this.snackbarColor = this.snackbarColor == "black" ? "grey" : "black";
+    },
     updateTitleSize(s) {
       this.titleSize = `${s}px`;
     },
-- 
cgit v1.2.3

