-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from qianmoQ/dev
[Page] [Layout] Add content
- Loading branch information
Showing
12 changed files
with
158 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { NavigationModel, NavigationPosition } from '@/model/Navigation' | ||
import NavigationService from '@/services/Navigation' | ||
import { Home, LogIn, LogOut } from 'lucide-vue-next' | ||
|
||
const createNavigation = (): void => { | ||
NavigationService.addNavigation(createNavigationItem('Home', undefined, '/home', Home, NavigationPosition.TOP)) | ||
NavigationService.addNavigation(createNavigationItem('Sign In', undefined, '/auth/signin', LogIn, NavigationPosition.TOP)) | ||
NavigationService.addNavigation(createNavigationItem('Sign Up', undefined, '/auth/signup', LogOut, NavigationPosition.BOTTOM)) | ||
} | ||
|
||
const createNavigationItem = (title?: string, label?: string, href?: string, icon?: any, position?: NavigationPosition, children?: NavigationModel[]): NavigationModel => { | ||
return { | ||
title: title, | ||
label: label, | ||
href: href, | ||
icon: icon, | ||
position: position, | ||
children: children | ||
} | ||
} | ||
|
||
export { | ||
createNavigation | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { createNavigation } from '@/data/Navigation' | ||
|
||
// Import navigation data | ||
createNavigation() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template> | ||
<LayoutSidebar @changeCollapsed="isCollapsed = $event"/> | ||
<div :class="cn(`overflow-auto ${isCollapsed ? 'md:ml-14' : 'md:ml-64'}`)"> | ||
<LayoutHeader/> | ||
<div class="p-2 space-y-2"> | ||
<RouterView/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import LayoutSidebar from '@/views/layouts/base/components/LayoutSidebar.vue' | ||
import { cn } from '@/lib/utils' | ||
import LayoutHeader from '@/views/layouts/base/components/LayoutHeader.vue' | ||
export default defineComponent({ | ||
name: 'LayoutContainer', | ||
components: {LayoutHeader, LayoutSidebar}, | ||
setup() | ||
{ | ||
return { | ||
cn | ||
} | ||
}, | ||
data() | ||
{ | ||
return { | ||
isCollapsed: false | ||
} | ||
} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<div class="flex h-[var(--header-height)] flex-none items-center gap-4 bg-background p-4 md:px-8 border-b"> | ||
I'm LayoutHeader | ||
</div> | ||
</template> | ||
|
||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { Button } from '@/components/ui/button' | ||
export default defineComponent({ | ||
name: 'LayoutHeader', | ||
components: {Button} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 15 additions & 7 deletions
22
src/views/layouts/base/components/components/NavigationClosed.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 22 additions & 14 deletions
36
src/views/layouts/base/components/components/NavigationOpened.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<Button class="w-full">Test Button</Button> | ||
<Button class="w-full">Test Button 2</Button> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { Button } from '@/components/ui/button' | ||
export default defineComponent({ | ||
name: 'HomeIndex', | ||
components: {Button} | ||
}) | ||
</script> |