大概逻辑:
接收一个to props值为String,并且必传
通过给路由前面拼接#实现hash路由
<template>
<a :href="`#${props.to}`"></a>
</template>
<script setup>
import { defineProps } from "vue";
let props = defineProps({
to: {
type: String,
required: true,
},
});
</script>