修改样式

This commit is contained in:
2025-12-04 14:23:49 +08:00
parent 5b3b55cf10
commit ed4780d6c2
6 changed files with 57 additions and 26 deletions

View File

@@ -8,10 +8,17 @@
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { useRouter, useRoute } from 'vue-router';
const home = ref<boolean>(false);
const router = useRouter();
const route = useRoute();
// 组件加载时根据当前路由判断是否在管理页
onMounted(() => {
// 如果当前路径以 /admin 开头,说明在管理页,应该显示"前往用户页"
home.value = route.path.startsWith('/admin');
});
function changeHome(){
if(home.value){