修改样式
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user