skyblued преди 2 години
родител
ревизия
4d04285aae
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 4 3
      src/views/accompany/index.tsx

+ 4 - 3
src/views/accompany/index.tsx

@@ -67,13 +67,14 @@ export default defineComponent({
       handleOpen()
     }
     const handleOpen = () => {
-      console.log('🚀 ~ route', route, route.path)
-      data.childPath = route?.path?.replaceAll?.('/', '') || 'accompany'
+      const src: string = route?.path || 'accompany'
+      console.log('🚀 ~ route.path', src)
+      data.childPath = src.replace(/\//g, '') || 'accompany'
     }
     watch(
       () => route.path,
       () => {
-        data.childPath = route?.path?.replaceAll?.('/', '') || 'accompany'
+        handleOpen()
       }
     )
     onMounted(() => {