diff --git a/packages/create-fes-app/templates/app/pc/package.json b/packages/create-fes-app/templates/app/pc/package.json index e6c3065f..54b42aa4 100644 --- a/packages/create-fes-app/templates/app/pc/package.json +++ b/packages/create-fes-app/templates/app/pc/package.json @@ -52,7 +52,7 @@ "@fesjs/plugin-layout": "^4.0.0", "@fesjs/plugin-model": "^2.0.0", "@fesjs/plugin-enums": "^2.0.0", - "@fesjs/fes-design": "^0.2.6", + "@fesjs/fes-design": "^0.3.0", "vue": "^3.2.6", "core-js": "^3.8.3" }, diff --git a/packages/fes-plugin-layout/package.json b/packages/fes-plugin-layout/package.json index 7223dc9b..15c1c502 100644 --- a/packages/fes-plugin-layout/package.json +++ b/packages/fes-plugin-layout/package.json @@ -31,7 +31,7 @@ }, "peerDependencies": { "@fesjs/fes": "^2.0.0", - "@fesjs/fes-design": "^0.2.6", + "@fesjs/fes-design": "^0.3.3", "vue": "^3.0.5" } } diff --git a/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue b/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue index c9643e34..adf1efda 100644 --- a/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue +++ b/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue @@ -3,7 +3,7 @@ - + @@ -234,7 +219,7 @@ export default { } }); - const collapsed = ref(false); + const collapsedRef = ref(false); const route = useRoute(); const runtimeConfig = plugin.applyPlugins({ key: 'layout', @@ -271,16 +256,24 @@ export default { } return config; }); - const currentFixedHeader = computed( + const currentFixedHeaderRef = computed( () => props.fixedHeader || props.navigation === 'mixin' ); + const headerStyleRef = computed(() => (currentFixedHeaderRef.value ? { top: `${headerHeightRef.value}px` } : {})); + const sideStyleRef = computed(() => (props.fixedSideBar + ? { + left: collapsedRef.value ? '48px' : `${props.sideWidth}px` + } + : {})); return { headerRef, headerHeightRef, route, routeLayout, - collapsed, - currentFixedHeader + collapsedRef, + currentFixedHeaderRef, + headerStyleRef, + sideStyleRef }; } }; diff --git a/packages/fes-template/.fes.js b/packages/fes-template/.fes.js index e9af40ae..82c2d81d 100644 --- a/packages/fes-template/.fes.js +++ b/packages/fes-template/.fes.js @@ -34,7 +34,7 @@ export default { title: 'Fes.js', footer: 'Created by MumbleFE', multiTabs: false, - navigation: 'mixin', + navigation: 'side', theme: 'dark', menus: [ { @@ -64,10 +64,6 @@ export default { title: '子菜单', path: '/menuTest' }, - { - title: '子菜单a', - path: '/menuTest/a' - } ] }, { diff --git a/packages/fes-template/package.json b/packages/fes-template/package.json index 547fe21a..84fda620 100644 --- a/packages/fes-template/package.json +++ b/packages/fes-template/package.json @@ -60,7 +60,7 @@ "@fesjs/plugin-monaco-editor": "^2.0.0-beta.0", "@fesjs/plugin-windicss": "^2.0.0", "@fesjs/plugin-pinia": "^2.0.0", - "@fesjs/fes-design": "^0.2.10", + "@fesjs/fes-design": "^0.3.3", "vue": "^3.0.5", "vuex": "^4.0.0", "pinia": "^2.0.11" diff --git a/packages/fes-template/src/pages/index.vue b/packages/fes-template/src/pages/index.vue index ec5f7c64..c8fb7f9b 100644 --- a/packages/fes-template/src/pages/index.vue +++ b/packages/fes-template/src/pages/index.vue @@ -21,6 +21,7 @@ export default { diff --git a/packages/fes-template/src/pages/menuTest/a.vue b/packages/fes-template/src/pages/menuTest/@id.vue similarity index 54% rename from packages/fes-template/src/pages/menuTest/a.vue rename to packages/fes-template/src/pages/menuTest/@id.vue index cb0d9d84..4977d60f 100644 --- a/packages/fes-template/src/pages/menuTest/a.vue +++ b/packages/fes-template/src/pages/menuTest/@id.vue @@ -1,14 +1,23 @@ + +{ + "title": "menuTest-详情" +} +