perf: redirect

This commit is contained in:
xiaoxian521
2022-03-14 12:43:02 +08:00
parent bef0d9234e
commit b36850f79f
3 changed files with 1 additions and 7 deletions

20
src/layout/redirect.vue Normal file
View File

@@ -0,0 +1,20 @@
<script setup lang="ts">
import { unref } from "vue";
import { useRouter } from "vue-router";
const { currentRoute, replace } = useRouter();
const { params, query } = unref(currentRoute);
const { path } = params;
const _path = Array.isArray(path) ? path.join("/") : path;
replace({
path: "/" + _path,
query
});
</script>
<template>
<div></div>
</template>