实现登录
This commit is contained in:
19
src/App.vue
19
src/App.vue
@@ -1,14 +1,31 @@
|
||||
<template>
|
||||
<MainLayout />
|
||||
<div id="app">
|
||||
<template v-if="isLoginPage">
|
||||
<router-view />
|
||||
</template>
|
||||
<template v-else>
|
||||
<MainLayout />
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import MainLayout from './layouts/MainLayout.vue';
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
MainLayout
|
||||
},
|
||||
setup() {
|
||||
const route = useRoute();
|
||||
const isLoginPage = computed(() => route.path === '/login');
|
||||
|
||||
return {
|
||||
isLoginPage
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user