index.vue 356 B

12345678910111213141516
  1. <template>
  2. <div></div>
  3. </template>
  4. <script setup lang="ts">
  5. import { unref } from 'vue'
  6. import { useRouter } from 'vue-router'
  7. const { currentRoute, replace } = useRouter()
  8. const { params, query } = unref(currentRoute)
  9. const { path } = params
  10. const _path = Array.isArray(path) ? path.join('/') : path
  11. replace({
  12. path: '/' + _path,
  13. query
  14. })
  15. </script>