Răsfoiți Sursa

修改授权登录

ZaiZai 1 an în urmă
părinte
comite
e6adb3a248
1 a modificat fișierele cu 8 adăugiri și 3 ștergeri
  1. 8 3
      src/layout/index.vue

+ 8 - 3
src/layout/index.vue

@@ -73,16 +73,21 @@ const appLogoName = ref(store.getLogoName)
 //菜单数据
 const menuBarKey = ref('')
 const menuBarData = ref([])
-const isLayout = ref(useRoutes?.query?.layout)
+const isLayout = ref('')
 
 //渲染完成
 onMounted(() => {
+    const layout = useRoutes?.query?.layout, layout2 = store.isLayout
+    isLayout.value = layout ?? layout2
     initButtons()
 })
 
 //监听layout
-watch(() => useRoutes?.query?.layout, (layout) => {
-    isLayout.value = layout
+watch(() => [
+    useRoutes?.query?.layout,
+    store.isLayout,
+], ([layout, layout2]) => {
+    isLayout.value = layout ?? layout2
 }, { deep: true })
 
 //路由信息