瀏覽代碼

fix: some known Issues

nian 1 月之前
父節點
當前提交
2825a06f8a

+ 1 - 1
src/layout/component/Tabs.vue

@@ -407,7 +407,7 @@ const InternalTabs = defineComponent({
 })
 
 watch(
-  (): [Tab[], string] => [tabsStore.tabs, tabsStore.tabActivePath],
+  [() => tabsStore.tabs, () => tabsStore.tabActivePath],
   ([newTabs, newTabActivePath], [oldTabs, oldTabActivePath]) => {
     if (!newTabActivePath) {
       tabBackgroundTransitionClasses.leaveToClass = 'scale-0 opacity-0'

+ 3 - 3
src/layout/header/LogoArea.vue

@@ -13,9 +13,9 @@ const logoAreaWrapRef = ref<HTMLElement | null>(null)
 const collapseWidth = ref(0)
 
 watch(
-  () => [
-    preferencesStore.preferences.navigationMode,
-    preferencesStore.preferences.sidebarMenu.collapsed,
+  [
+    () => preferencesStore.preferences.navigationMode,
+    () => preferencesStore.preferences.sidebarMenu.collapsed,
   ],
   ([navigationMode, isCollapsed]) => {
     if (navigationMode === 'horizontal') {

+ 10 - 13
src/layout/index.vue

@@ -35,19 +35,16 @@ const layoutTranslateOffset = computed(() => {
       : 0
 })
 
-watch(
-  () => isSmallScreen.value,
-  (isSmallScreen) => {
-    if (isSmallScreen) {
-      preferencesStore.modify({
-        sidebarMenu: {
-          collapsed: false,
-        },
-      })
-      setLayoutSlideDirection(null)
-    }
-  },
-)
+watch(isSmallScreen, (isSmallScreen) => {
+  if (isSmallScreen) {
+    preferencesStore.modify({
+      sidebarMenu: {
+        collapsed: false,
+      },
+    })
+    setLayoutSlideDirection(null)
+  }
+})
 </script>
 <template>
   <div

+ 1 - 1
src/layout/main/index.vue

@@ -62,7 +62,7 @@ function createTabFromRoute(route: RouteLocationNormalizedLoaded) {
 }
 
 watch(
-  (): [Tab[], string] => [tabsStore.tabs, tabsStore.tabActivePath],
+  [() => tabsStore.tabs, () => tabsStore.tabActivePath],
   ([newTabs, newTabActivePath], [, oldTabActivePath]) => {
     if (
       newTabActivePath &&

+ 3 - 3
src/views/dashboard/index.vue

@@ -1051,9 +1051,9 @@ function resizeAllCharts() {
 }
 
 watch(
-  () => [
-    preferencesStore.preferences.sidebarMenu.collapsed,
-    preferencesStore.preferences.navigationMode,
+  [
+    () => preferencesStore.preferences.sidebarMenu.collapsed,
+    () => preferencesStore.preferences.navigationMode,
   ],
   () => {
     if (collapseResizeTimeout !== null) {

+ 4 - 6
src/views/data-show/data-form/index.vue

@@ -187,17 +187,15 @@ function removePhoneField(index: number) {
 }
 
 watch(
-  [form],
-  async (newVal) => {
-    const [form] = newVal
-
+  form,
+  async (newForm) => {
     if (!codeToHtml) {
       // @ts-ignore
       const shiki = await import('https://cdn.jsdelivr.net/npm/shiki@3.7.0/+esm')
       codeToHtml = shiki.codeToHtml
     }
 
-    codeToHtml(JSON.stringify(form, null, 2), {
+    codeToHtml(JSON.stringify(newForm, null, 2), {
       lang: 'json',
       themes: {
         dark: 'dark-plus',
@@ -205,7 +203,7 @@ watch(
       },
     })
       .then((result: string) => (formCodeHighlight.value = result))
-      .catch(() => (formCodeHighlight.value = JSON.stringify(form, null, 2)))
+      .catch(() => (formCodeHighlight.value = JSON.stringify(newForm, null, 2)))
 
     codeToHtml(JSON.stringify(rules, null, 2), {
       lang: 'json',