From fa44bcc2861fe56e8af50fbd8f56065250a2ece3 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期四, 06 一月 2022 10:08:07 +0800
Subject: [PATCH] 报错处理

---
 src/pages/settings/components/switchBar.vue |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/pages/settings/components/switchBar.vue b/src/pages/settings/components/switchBar.vue
index 507253f..d68bec7 100644
--- a/src/pages/settings/components/switchBar.vue
+++ b/src/pages/settings/components/switchBar.vue
@@ -2,8 +2,8 @@
   <div class="switch-bar">
     <div class="name">{{ barName }}</div>
     <el-switch
-      v-model="value"
-      active-color="#4e94ff"
+      v-model="barValue"
+      active-color="var(--colorCard)"
       :width="30"
       @change="switchChange"
     >
@@ -13,10 +13,21 @@
 
 <script>
 export default {
+  name: "switchBar",
   props: ["barName", "value"],
   methods: {
     switchChange(val) {
       this.$emit("switchChange", val);
+    },
+  },
+  computed: {
+    barValue: {
+      get() {
+        return this.value;
+      },
+      set(newValue) {
+        return newValue;
+      },
     },
   },
 };
@@ -28,9 +39,9 @@
   height: 50px;
   padding: 0 25px;
   justify-content: space-between;
-border-radius: 8px;
+  border-radius: 8px;
 
-  margin-bottom: 10px;
+  margin-bottom: 4px;
   .el-switch.is-checked .el-switch__core::after {
     left: 100%;
     margin-left: -12px;

--
Gitblit v1.8.0