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` | :::