fix: menu 组件 level 属性不生效

This commit is contained in:
就眠儀式 2022-03-27 06:26:08 +08:00
parent 8169e54846
commit 7411fdca76
4 changed files with 18 additions and 7 deletions

View File

@ -106,7 +106,7 @@ export default {
::: demo
<template>
<lay-menu level="true" v-model:selectedKey="selectedKey" inverted="true" v-model:openKeys="openKeys3" :tree="true">
<lay-menu :level="isLevel" v-model:selectedKey="selectedKey" inverted="true" v-model:openKeys="openKeys3" :tree="true">
<lay-menu-item id="1">首页</lay-menu-item>
<lay-menu-item id="2">首页</lay-menu-item>
<lay-menu-item id="3">首页</lay-menu-item>
@ -134,10 +134,12 @@ import { ref } from 'vue'
export default {
setup() {
const openKeys3 = ref(["7"])
const selectedKey = ref("5")
const isLevel = ref(false);
const openKeys3 = ref(["7"]);
const selectedKey = ref("5");
return {
isLevel,
openKeys3,
selectedKey
}

View File

@ -11,6 +11,15 @@
<template>
<lay-timeline>
<lay-timeline-item title="0.4.0">
<ul>
<a name="0-4-3"> </a>
<li>
<h3>0.4.3 <span class="layui-badge-rim">2022-03-27</span></h3>
<ul>
<li>[修复] menu 组件 level 属性不生效。</li>
</ul>
</li>
</ul>
<ul>
<a name="0-4-2"> </a>
<li>

View File

@ -327,8 +327,8 @@
padding: 5px 17px 5px 17px;
}
.layui-nav-tree.level {
.layui-nav-itemed > .layui-nav-child {
.layui-nav-tree.not-level {
.layui-nav-child {
background-color: transparent;
}
}

View File

@ -27,7 +27,7 @@ const props = withDefaults(defineProps<LayMenuProps>(), {
tree: false,
theme: "dark",
inverted: false,
level: false,
level: true,
collapse: false,
collapseTransition: true,
});
@ -82,7 +82,7 @@ provide("isCollapseTransition", isCollapseTransition);
<ul
class="layui-nav"
:class="[
level ? 'level' : '',
level ? '' : 'not-level',
inverted ? 'inverted' : '',
tree ? 'layui-nav-tree' : '',
theme === 'dark' ? 'layui-nav-dark' : 'layui-nav-light',