wip(Layout): Layout developing
This commit is contained in:
parent
71dfba21c5
commit
66e8d0e41c
|
@ -8,8 +8,6 @@ import type { LayoutType } from '@/config/app'
|
||||||
import { useRenderMenuItem } from './components/useRenderMenuItem'
|
import { useRenderMenuItem } from './components/useRenderMenuItem'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { isUrl } from '@/utils/is'
|
import { isUrl } from '@/utils/is'
|
||||||
import { lighten } from '@/utils/color'
|
|
||||||
console.log(lighten('#001529', 6))
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'Menu',
|
name: 'Menu',
|
||||||
|
@ -94,8 +92,6 @@ export default defineComponent({
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@prefix-cls: ~'@{namespace}-menu';
|
@prefix-cls: ~'@{namespace}-menu';
|
||||||
|
|
||||||
@menuBgColor: var(--left-menu-bg-color);
|
|
||||||
|
|
||||||
.@{prefix-cls} {
|
.@{prefix-cls} {
|
||||||
:deep(.el-menu) {
|
:deep(.el-menu) {
|
||||||
border-right: none;
|
border-right: none;
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
import TagsView from './src/TagsView.vue'
|
||||||
|
|
||||||
|
export { TagsView }
|
|
@ -0,0 +1,5 @@
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>tagsView</div>
|
||||||
|
</template>
|
|
@ -4,6 +4,7 @@ import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store/modules/app'
|
||||||
import { Menu } from '@/components/Menu'
|
import { Menu } from '@/components/Menu'
|
||||||
import { useDesign } from '@/hooks/web/useDesign'
|
import { useDesign } from '@/hooks/web/useDesign'
|
||||||
|
// import { TagsView } from '@/components/TagsView'
|
||||||
|
|
||||||
const tagsViewStore = useTagsViewStore()
|
const tagsViewStore = useTagsViewStore()
|
||||||
|
|
||||||
|
@ -12,7 +13,7 @@ const getCaches = computed((): string[] => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
console.log(appStore)
|
|
||||||
const classSuffix = computed(() => appStore.getLayout)
|
const classSuffix = computed(() => appStore.getLayout)
|
||||||
|
|
||||||
const { getPrefixCls } = useDesign()
|
const { getPrefixCls } = useDesign()
|
||||||
|
@ -26,8 +27,28 @@ export default defineComponent({
|
||||||
<section
|
<section
|
||||||
class={[perFixCls, `${perFixCls}__${classSuffix.value}`, 'w-[100%] h-[100%] relative']}
|
class={[perFixCls, `${perFixCls}__${classSuffix.value}`, 'w-[100%] h-[100%] relative']}
|
||||||
>
|
>
|
||||||
<Menu></Menu>
|
<Menu class="absolute top-0 left-0"></Menu>
|
||||||
<router-view class="absolute top-0 right-0 ">
|
<div
|
||||||
|
class={[
|
||||||
|
`${perFixCls}-right`,
|
||||||
|
'absolute top-0 h-[100%]',
|
||||||
|
appStore.getCollapse
|
||||||
|
? 'w-[calc(100%-var(--left-menu-min-width))]'
|
||||||
|
: 'w-[calc(100%-var(--left-menu-max-width))]',
|
||||||
|
appStore.getCollapse
|
||||||
|
? 'left-[var(--left-menu-min-width)]'
|
||||||
|
: 'left-[var(--left-menu-max-width)]'
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class={[
|
||||||
|
`${perFixCls}-right__tool`,
|
||||||
|
'h-[var(--top-tool-height)] relative px-[var(--top-tool-p-x)] flex items-center'
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
ssss
|
||||||
|
</div>
|
||||||
|
<router-view>
|
||||||
{{
|
{{
|
||||||
default: ({ Component, route }) => (
|
default: ({ Component, route }) => (
|
||||||
<KeepAlive include={getCaches.value}>
|
<KeepAlive include={getCaches.value}>
|
||||||
|
@ -36,8 +57,29 @@ export default defineComponent({
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
</router-view>
|
</router-view>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
@prefix-cls: ~'@{namespace}-app';
|
||||||
|
|
||||||
|
.@{prefix-cls} {
|
||||||
|
&-right {
|
||||||
|
&__tool {
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
border-top: 1px solid var(--top-tool-border-color);
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -14,4 +14,12 @@
|
||||||
--left-menu-text-color: #bfcbd9;
|
--left-menu-text-color: #bfcbd9;
|
||||||
|
|
||||||
--left-menu-text-active-color: #fff;
|
--left-menu-text-active-color: #fff;
|
||||||
|
|
||||||
|
--top-tool-height: 40px;
|
||||||
|
|
||||||
|
--top-tool-p-x: 20px;
|
||||||
|
|
||||||
|
--top-tool-border-color: #eee;
|
||||||
|
|
||||||
|
--tags-view-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue