-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c5770d
commit 006467a
Showing
13 changed files
with
150 additions
and
81 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 |
---|---|---|
@@ -1,35 +1,3 @@ | ||
# soybean-admin-thin | ||
|
||
This template should help get you started developing with Vue 3 in Vite. | ||
|
||
## Recommended IDE Setup | ||
|
||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). | ||
|
||
## Type Support for `.vue` Imports in TS | ||
|
||
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. | ||
|
||
However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can run `Volar: Switch TS Plugin on/off` from VSCode command palette. | ||
|
||
## Customize configuration | ||
|
||
See [Vite Configuration Reference](https://vitejs.dev/config/). | ||
|
||
## Project Setup | ||
|
||
```sh | ||
npm install | ||
``` | ||
|
||
### Compile and Hot-Reload for Development | ||
|
||
```sh | ||
npm run dev | ||
``` | ||
|
||
### Type-Check, Compile and Minify for Production | ||
|
||
```sh | ||
npm run build | ||
``` | ||
soybean-admin重构版,新添加动态权限路由 |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,92 @@ | ||
<template> | ||
<div class="flex flex-col h-full"> | ||
<header | ||
:class="{ 'fixed-lt': topFixed }" | ||
:style="{ height: headerHeight + 'px', paddingLeft: headerPaddingLeft }" | ||
class="z-1001 flex-shrink-0 w-full bg-white border-b border-gray-200 transition-all duration-300 ease-in-out" | ||
> | ||
<slot name="header"> | ||
<h3>Header</h3> | ||
</slot> | ||
</header> | ||
<div | ||
:class="{ fixed: topFixed }" | ||
:style="{ top: headerHeight + 'px', height: tabHeight + 'px', paddingLeft: siderWidth }" | ||
class="left-0 z-999 flex-shrink-0 w-full bg-white border-b border-gray-200 transition-all duration-300 ease-in-out" | ||
> | ||
<slot name="tab"> | ||
<div>Tab</div> | ||
</slot> | ||
</div> | ||
<aside | ||
:style="{ width: siderWidth, paddingTop: siderPaddingTop }" | ||
:class="[isVertical ? 'z-1002' : 'z-1000']" | ||
class="fixed-lt h-full transition-all duration-300 ease-in-out bg-white border-r border-gray-200" | ||
> | ||
<slot name="sider"> | ||
<n-space :vertical="true" align="center" class="pt-24px"> | ||
<n-button type="primary" @click="toggle">折叠</n-button> | ||
<div> | ||
<span class="pr-12px">固定头部和标签</span> | ||
<n-switch v-model:value="fixed" /> | ||
</div> | ||
<div> | ||
<span class="pr-12px">vertical布局</span> | ||
<n-switch v-model:value="isVertical" /> | ||
</div> | ||
</n-space> | ||
</slot> | ||
</aside> | ||
<main | ||
class="flex-1 transition-all duration-300 ease-in-out" | ||
:style="{ paddingLeft: siderWidth, paddingTop: mainPaddingTop }" | ||
> | ||
<slot></slot> | ||
</main> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref, computed } from 'vue'; | ||
import { NSpace, NButton, NSwitch } from 'naive-ui'; | ||
import { useBoolean } from '@/hooks'; | ||
interface Props { | ||
/** 头部高度 */ | ||
headerHeight?: number; | ||
/** 标签页高度 */ | ||
tabHeight?: number; | ||
/** 固定头部和标签 */ | ||
fixdTop?: boolean; | ||
/** 侧边栏高度 */ | ||
siderWidth?: number; | ||
/** 侧边栏折叠状态的高度 */ | ||
siderCollapsedWidth?: number; | ||
/** 侧边栏折叠状态 */ | ||
siderCollapse?: boolean; | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
headerHeight: 56, | ||
tabHeight: 44, | ||
fixdTop: true, | ||
topZIndex: 1000, | ||
siderWidth: 200, | ||
siderZIndex: 1001, | ||
siderCollapsedWidth: 64, | ||
siderCollapse: false | ||
}); | ||
const { bool: collapse, toggle } = useBoolean(); | ||
const fixed = ref(true); | ||
const isVertical = ref(true); | ||
const topFixed = computed(() => fixed.value || !isVertical.value); | ||
const siderWidth = computed(() => `${collapse.value ? props.siderCollapsedWidth : props.siderWidth}px`); | ||
const headerPaddingLeft = computed(() => (isVertical.value ? siderWidth.value : '0px')); | ||
const siderPaddingTop = computed(() => (isVertical.value ? '0px' : `${props.headerHeight}px`)); | ||
const mainPaddingTop = computed(() => `${fixed.value ? props.headerHeight + props.tabHeight : 0}px`); | ||
</script> | ||
<style scoped></style> |
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,3 @@ | ||
import BasicLayout from './BasicLayout.vue'; | ||
|
||
export { BasicLayout }; |
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 |
---|---|---|
@@ -1,16 +1,11 @@ | ||
<template> | ||
<div class="h-full"> | ||
<router-view v-slot="{ Component }"> | ||
<transition name="fade-slide" mode="out-in" appear> | ||
<component :is="Component" v-if="app.reloadFlag" /> | ||
</transition> | ||
</router-view> | ||
</div> | ||
<basic-layout> | ||
<global-content /> | ||
</basic-layout> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useAppStore } from '@/store'; | ||
const app = useAppStore(); | ||
import { GlobalContent } from '../common'; | ||
import { BasicLayout } from './components'; | ||
</script> | ||
<style scoped></style> |
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> | ||
<router-view v-slot="{ Component }"> | ||
<transition name="fade-slide" mode="out-in" appear> | ||
<component :is="Component" v-if="app.reloadFlag" /> | ||
</transition> | ||
</router-view> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useAppStore } from '@/store'; | ||
const app = useAppStore(); | ||
</script> | ||
<style scoped></style> |
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,3 @@ | ||
import GlobalContent from './GlobalContent/index.vue'; | ||
|
||
export { GlobalContent }; |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
@import './scrollbar.css'; | ||
@import './transition.css'; | ||
|
||
html, body, #app { | ||
|
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
Oops, something went wrong.