新增 menu 组件 level 层级

This commit is contained in:
就眠儀式
2022-01-30 21:50:38 +08:00
parent c7ebbe733a
commit 5fe02df5db
3 changed files with 38 additions and 29 deletions

View File

@@ -302,4 +302,10 @@
.layui-nav-tree.inverted .layui-this > a{
padding: 5px 24px 5px 24px;
}
.layui-nav-tree.level {
.layui-nav-itemed > .layui-nav-child {
background-color: transparent;
}
}

View File

@@ -1,5 +1,5 @@
<template>
<ul class="layui-nav" :class="[inverted ? 'inverted':'',tree ? 'layui-nav-tree' : '', theme === 'dark' ? 'layui-nav-dark':'layui-nav-light' ]">
<ul class="layui-nav" :class="[level? 'level':'',inverted ? 'inverted':'',tree ? 'layui-nav-tree' : '', theme === 'dark' ? 'layui-nav-dark':'layui-nav-light' ]">
<slot></slot>
</ul>
</template>
@@ -14,6 +14,7 @@ export interface LayMenuProps {
tree?: boolean;
theme?: string;
inverted?: boolean;
level?: boolean;
}
const emit = defineEmits(["update:selectedKey", "update:openKeys"]);
@@ -23,7 +24,8 @@ const props = withDefaults(defineProps<LayMenuProps>(), {
openKeys: () => [],
tree: false,
theme: 'dark',
inverted: false
inverted: false,
level: false
});
const isTree = computed(() => props.tree);