Merge remote-tracking branch 'origin/main'

# Conflicts:
#	src/components/Container.vue
This commit is contained in:
Twilight 2024-03-26 11:20:56 +08:00
commit 4ccc93512d
4 changed files with 95 additions and 14 deletions

View File

@ -10,7 +10,7 @@ import {
useOsTheme,
zhCN,dateZhCN
} from 'naive-ui'
import Container from "@/components/Container.vue";
import Container from "@/components/ManageLayout.vue";
const osTheme = useOsTheme()
const theme = computed(() => (osTheme.value === 'dark' ? darkTheme : null))
@ -23,7 +23,7 @@ const theme = computed(() => (osTheme.value === 'dark' ? darkTheme : null))
<n-message-provider>
<n-global-style/>
<n-dialog-provider>
<Container></Container>
<router-view />
</n-dialog-provider>
</n-message-provider>

View File

@ -0,0 +1,64 @@
<script setup lang="ts">
import type {MenuOption} from 'naive-ui'
import {NIcon, NLayout, NLayoutSider, NMenu} from "naive-ui"
import {RouterLink} from "vue-router"
import {type Component, h, ref} from 'vue'
import {
HomeOutline as HomeIcon,
} from '@vicons/ionicons5'
function renderIcon(icon: Component) {
return () => h(NIcon, null, {default: () => h(icon)})
}
const collapsed = ref(false)
const menuOptions: MenuOption[] = [
{
label: () =>
h(
RouterLink,
{
to: {
name: 'manage.index',
}
},
{default: () => '中台'}
),
key: 'go-back-home',
icon: renderIcon(HomeIcon)
},
]
</script>
<template>
<n-layout has-sider class="min-h-screen">
<n-layout-sider bordered
collapse-mode="width"
:collapsed-width="64"
:width="240"
:collapsed="collapsed"
show-trigger
@collapse="collapsed = true"
@expand="collapsed = false">
<n-menu
:collapsed="collapsed"
:collapsed-width="64"
:collapsed-icon-size="22"
:options="menuOptions"/>
</n-layout-sider>
<n-layout embedded :native-scrollbar="false"
content-style="padding: 24px;padding-top: 10px" class="min-h-screen">
<slot/>
</n-layout>
</n-layout>
</template>
<style scoped>
</style>

View File

@ -1,13 +1,16 @@
<script setup lang="ts">
import {NH1, NText} from 'naive-ui'
import ManageLayout from "@/components/ManageLayout.vue";
</script>
<template>
<ManageLayout>
<n-h1>
<n-text type="primary">
中台
</n-text>
</n-h1>
</ManageLayout>
</template>
<style scoped>

View File

@ -18,9 +18,9 @@
integrity sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==
"@babel/runtime@^7.21.0":
version "7.24.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.0.tgz#584c450063ffda59697021430cb47101b085951e"
integrity sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw==
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.1.tgz#431f9a794d173b53720e69a6464abc6f0e2a5c57"
integrity sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==
dependencies:
regenerator-runtime "^0.14.0"
@ -2027,8 +2027,16 @@ source-map-js@^1.0.2, source-map-js@^1.1.0:
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.1.0.tgz#9e7d5cb46f0689fb6691b30f226937558d0fa94b"
integrity sha512-9vC2SfsJzlej6MAaMPLu8HiBSHGdRAJ9hVFYN1ibZoNkeanmDmLUcIrj6G9DGL7XMJ54AKg/G75akXl1/izTOw==
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0:
name string-width-cjs
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
string-width@^4.1.0:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@ -2046,8 +2054,14 @@ string-width@^5.0.1, string-width@^5.1.2:
emoji-regex "^9.2.2"
strip-ansi "^7.0.1"
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
name strip-ansi-cjs
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==