mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2026-01-22 23:50:22 +08:00
feat: 添加simple、normal、full 等layout布局
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!--------------------------------
|
||||
- @Author: Ronnie Zhang
|
||||
- @LastEditor: Ronnie Zhang
|
||||
- @LastEditTime: 2023/12/05 21:30:17
|
||||
- @LastEditTime: 2023/12/16 18:49:42
|
||||
- @Email: zclzone@outlook.com
|
||||
- Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
|
||||
--------------------------------->
|
||||
@@ -21,14 +21,14 @@
|
||||
</KeepAlive>
|
||||
</component>
|
||||
|
||||
<ThemeSetting class="fixed bottom-12 right-12" />
|
||||
<LayoutSetting class="fixed right-12 top-1/2 z-999" />
|
||||
</router-view>
|
||||
</n-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { zhCN, dateZhCN, darkTheme } from 'naive-ui'
|
||||
import { ThemeSetting } from '@/components'
|
||||
import { LayoutSetting } from '@/components'
|
||||
import { useCssVar } from '@vueuse/core'
|
||||
import { kebabCase } from 'lodash-es'
|
||||
import { useAppStore, useTabStore } from '@/store'
|
||||
@@ -44,6 +44,7 @@ function getLayout(name) {
|
||||
|
||||
const route = useRoute()
|
||||
const appStore = useAppStore()
|
||||
if (appStore.layout === 'default') appStore.setLayout('')
|
||||
const Layout = computed(() => {
|
||||
if (!route.matched?.length) return null
|
||||
return getLayout(route.meta?.layout || appStore.layout)
|
||||
|
||||
Reference in New Issue
Block a user