You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
665 B
Plaintext
31 lines
665 B
Plaintext
<template>
|
|
<div></div>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import { unref } from 'vue';
|
|
import { useRouter } from 'vue-router';
|
|
|
|
const { currentRoute, replace } = useRouter();
|
|
|
|
const { params, query } = unref(currentRoute);
|
|
const { path, _redirect_type = 'path' } = params;
|
|
|
|
Reflect.deleteProperty(params, '_redirect_type');
|
|
Reflect.deleteProperty(params, 'path');
|
|
|
|
const _path = Array.isArray(path) ? path.join('/') : path;
|
|
|
|
if (_redirect_type === 'name') {
|
|
replace({
|
|
name: _path,
|
|
query,
|
|
params,
|
|
});
|
|
} else {
|
|
replace({
|
|
path: _path.startsWith('/') ? _path : '/' + _path,
|
|
query,
|
|
});
|
|
}
|
|
</script>
|