瀏覽代碼

no message

libushang 5 月之前
父節點
當前提交
602665b4b4
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/components/Tabbar/index.vue

+ 4 - 4
src/components/Tabbar/index.vue

@@ -31,13 +31,13 @@ import useUserStore from "@/store/modules/user";
 import { getUnreadMsgCount } from "@/api/InformationReception/InformationReception";
 
 const active = ref(0);
-let tabBarData = reactive([]);
+let tabBarData = ref([]);
 watch(
   () => useUserStore().roles,
   () => {
     const roles = useUserStore().roles;
     if (roles.includes("leader")) {
-      tabBarData = [
+      tabBarData.value = [
         {
           icon: "index",
           iconActive: "indexActive",
@@ -83,7 +83,7 @@ watch(
         // }
       ];
     } else if (roles.includes("worker")) {
-      tabBarData = [
+      tabBarData.value = [
         {
           icon: "index",
           iconActive: "indexActive",
@@ -153,7 +153,7 @@ const stopFetchingData = () => {
 
 const fetchData = async () => {
   getUnreadMsgCount({"msg_types": "事件管理,值班管理"}).then((res)=>{
-    tabBarData.forEach((v)=>{
+    tabBarData.value.forEach((v)=>{
       let obj = res.data.find(item=>item.name === v.title);
       if(obj) {
         v.num = ""+obj.num;