From cf2c7b5e7281f58fa827992f32828532b055c39a Mon Sep 17 00:00:00 2001 From: ice-creams Date: Thu, 5 May 2022 11:35:37 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8:=20menu=E7=BB=84=E4=BB=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9EchildSpacing=E5=B1=9E=E6=80=A7=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8E=E7=88=B6=E8=8F=9C=E5=8D=95=E7=9A=84=E9=97=B4=E8=B7=9D?= =?UTF-8?q?=E4=BB=A5=E6=9B=B4=E5=A5=BD=E7=9A=84=E8=BF=9B=E8=A1=8C=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E5=88=86=E8=BE=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/src/component/menu/index.less | 5 +++++ package/component/src/component/menu/index.vue | 3 +++ package/document/src/document/zh-CN/components/menu.md | 1 + 3 files changed, 9 insertions(+) diff --git a/package/component/src/component/menu/index.less b/package/component/src/component/menu/index.less index cef8cac0..5d820b81 100644 --- a/package/component/src/component/menu/index.less +++ b/package/component/src/component/menu/index.less @@ -309,3 +309,8 @@ background-color: transparent; } } + +.layui-nav-child-spacing .layui-nav-item .layui-nav-child { + padding-left: 10px; + box-sizing: border-box; +} diff --git a/package/component/src/component/menu/index.vue b/package/component/src/component/menu/index.vue index ea595a36..2fb6bbd7 100644 --- a/package/component/src/component/menu/index.vue +++ b/package/component/src/component/menu/index.vue @@ -17,6 +17,7 @@ export interface LayMenuProps { level?: boolean | string; collapse?: boolean | string; collapseTransition?: boolean | string; + childSpacing?: boolean; } const emit = defineEmits([ @@ -35,6 +36,7 @@ const props = withDefaults(defineProps(), { level: true, collapse: false, collapseTransition: true, + childSpacing: false, }); const isTree = computed(() => props.tree); @@ -91,6 +93,7 @@ provide("isCollapseTransition", isCollapseTransition); tree ? 'layui-nav-tree' : '', theme === 'dark' ? 'layui-nav-dark' : 'layui-nav-light', collapse ? 'layui-nav-collapse' : '', + childSpacing ? 'layui-nav-child-spacing' : '', ]" > diff --git a/package/document/src/document/zh-CN/components/menu.md b/package/document/src/document/zh-CN/components/menu.md index a157540d..fafb4392 100644 --- a/package/document/src/document/zh-CN/components/menu.md +++ b/package/document/src/document/zh-CN/components/menu.md @@ -487,6 +487,7 @@ export default { | level | 菜单层级 | `true` `false` | | collapse | 折叠状态 | `true` `false` | | collapse-transition | 折叠动画 | `true` `false` | +| child-spacing | 子菜单增加间距 | `true` `false` | :::