废除 menu-children-item 组件, 菜单初步支持无限极
This commit is contained in:
parent
6d0ecc7f74
commit
923e16a5d7
@ -12,9 +12,13 @@
|
|||||||
<lay-menu-item title="用户" id="2"></lay-menu-item>
|
<lay-menu-item title="用户" id="2"></lay-menu-item>
|
||||||
<lay-menu-item title="角色" id="3"></lay-menu-item>
|
<lay-menu-item title="角色" id="3"></lay-menu-item>
|
||||||
<lay-menu-item title="目录" id="7">
|
<lay-menu-item title="目录" id="7">
|
||||||
<lay-menu-child-item title="菜单一" id="4"></lay-menu-child-item>
|
<lay-menu-item title="菜单一" id="8"></lay-menu-item>
|
||||||
<lay-menu-child-item title="菜单二" id="5"></lay-menu-child-item>
|
<lay-menu-item title="菜单二" id="9"></lay-menu-item>
|
||||||
<lay-menu-child-item title="菜单三" id="6"></lay-menu-child-item>
|
<lay-menu-item title="菜单三" id="10">
|
||||||
|
<lay-menu-item title="菜单一" id="11"></lay-menu-item>
|
||||||
|
<lay-menu-item title="菜单二" id="12"></lay-menu-item>
|
||||||
|
<lay-menu-item title="菜单三" id="13"></lay-menu-item>
|
||||||
|
</lay-menu-item>
|
||||||
</lay-menu-item>
|
</lay-menu-item>
|
||||||
</lay-menu>
|
</lay-menu>
|
||||||
</template>
|
</template>
|
||||||
@ -52,9 +56,13 @@ export default {
|
|||||||
<lay-menu-item title="用户" id="2"></lay-menu-item>
|
<lay-menu-item title="用户" id="2"></lay-menu-item>
|
||||||
<lay-menu-item title="角色" id="3"></lay-menu-item>
|
<lay-menu-item title="角色" id="3"></lay-menu-item>
|
||||||
<lay-menu-item title="目录" id="7">
|
<lay-menu-item title="目录" id="7">
|
||||||
<lay-menu-child-item title="菜单一" id="4"></lay-menu-child-item>
|
<lay-menu-item title="菜单一" id="8"></lay-menu-item>
|
||||||
<lay-menu-child-item title="菜单二" id="5"></lay-menu-child-item>
|
<lay-menu-item title="菜单二" id="9"></lay-menu-item>
|
||||||
<lay-menu-child-item title="菜单三" id="6"></lay-menu-child-item>
|
<lay-menu-item title="菜单三" id="10">
|
||||||
|
<lay-menu-item title="菜单一" id="11"></lay-menu-item>
|
||||||
|
<lay-menu-item title="菜单二" id="12"></lay-menu-item>
|
||||||
|
<lay-menu-item title="菜单三" id="13"></lay-menu-item>
|
||||||
|
</lay-menu-item>
|
||||||
</lay-menu-item>
|
</lay-menu-item>
|
||||||
</lay-menu>
|
</lay-menu>
|
||||||
</template>
|
</template>
|
||||||
|
@ -2844,6 +2844,25 @@ body .layui-table-tips .layui-layer-content {
|
|||||||
color: #5fb878;
|
color: #5fb878;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.layui-nav .layui-show.layui-anim-upbit .layui-show.layui-anim-upbit {
|
||||||
|
top: 0px;
|
||||||
|
left: 106px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layui-nav .layui-show.layui-anim-upbit .layui-nav-item {
|
||||||
|
display: block;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layui-nav .layui-show.layui-anim-upbit .layui-nav-item.layui-this {
|
||||||
|
background-color: whitesmoke;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layui-nav .layui-show.layui-anim-upbit .layui-nav-item.layui-this:after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.layui-nav {
|
.layui-nav {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
@ -2868,7 +2887,7 @@ body .layui-table-tips .layui-layer-content {
|
|||||||
|
|
||||||
.layui-nav .layui-nav-item a {
|
.layui-nav .layui-nav-item a {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0 20px;
|
padding: 0 30px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
color: rgba(255, 255, 255, 0.7);
|
color: rgba(255, 255, 255, 0.7);
|
||||||
-webkit-transition: all 0.3s;
|
-webkit-transition: all 0.3s;
|
||||||
@ -2917,7 +2936,7 @@ body .layui-table-tips .layui-layer-content {
|
|||||||
.layui-nav .layui-nav-more {
|
.layui-nav .layui-nav-more {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 3px;
|
right: 8px;
|
||||||
left: auto !important;
|
left: auto !important;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
font-size: 12.5px !important;
|
font-size: 12.5px !important;
|
||||||
|
@ -40,7 +40,6 @@ import LayContainer from "./module/container/index";
|
|||||||
import LayCountUp from "./module/countUp/index";
|
import LayCountUp from "./module/countUp/index";
|
||||||
import LayMenu from "./module/menu/index";
|
import LayMenu from "./module/menu/index";
|
||||||
import LayMenuItem from "./module/menuItem/index";
|
import LayMenuItem from "./module/menuItem/index";
|
||||||
import LayMenuChildItem from "./module/menuChildItem/index";
|
|
||||||
import LayCheckbox from "./module/checkbox/index";
|
import LayCheckbox from "./module/checkbox/index";
|
||||||
import LayCheckboxGroup from "./module/checkboxGroup/index";
|
import LayCheckboxGroup from "./module/checkboxGroup/index";
|
||||||
import LayForm from "./module/form/index";
|
import LayForm from "./module/form/index";
|
||||||
@ -101,7 +100,6 @@ const components: Record<string, IDefineComponent> = {
|
|||||||
LayContainer,
|
LayContainer,
|
||||||
LayMenu,
|
LayMenu,
|
||||||
LayMenuItem,
|
LayMenuItem,
|
||||||
LayMenuChildItem,
|
|
||||||
LayCheckbox,
|
LayCheckbox,
|
||||||
LayForm,
|
LayForm,
|
||||||
LayBreadcrumb,
|
LayBreadcrumb,
|
||||||
@ -178,7 +176,6 @@ export {
|
|||||||
LayContainer,
|
LayContainer,
|
||||||
LayMenu,
|
LayMenu,
|
||||||
LayMenuItem,
|
LayMenuItem,
|
||||||
LayMenuChildItem,
|
|
||||||
LayCheckbox,
|
LayCheckbox,
|
||||||
LayForm,
|
LayForm,
|
||||||
LayBreadcrumb,
|
LayBreadcrumb,
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
import type { App } from "vue";
|
|
||||||
import Component from "./index.vue";
|
|
||||||
import type { IDefineComponent } from "../type/index";
|
|
||||||
|
|
||||||
Component.install = (app: App) => {
|
|
||||||
app.component(Component.name || "LayMenuChildItem", Component);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Component as IDefineComponent;
|
|
@ -1,25 +0,0 @@
|
|||||||
<template>
|
|
||||||
<dd :class="[selectedKey === id ? 'layui-this' : '']" @click="selectHandle()">
|
|
||||||
<slot v-if="slots.title" name="title"></slot>
|
|
||||||
<a v-else href="javascript:void(0)">
|
|
||||||
{{ title }}
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="LayMenuChildItem" lang="ts">
|
|
||||||
import { defineProps, inject, Ref, useSlots } from "vue";
|
|
||||||
|
|
||||||
const slots = useSlots();
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const selectedKey: Ref<string> = inject("selectedKey") as Ref<string>;
|
|
||||||
|
|
||||||
const selectHandle = function () {
|
|
||||||
selectedKey.value = props.id;
|
|
||||||
};
|
|
||||||
</script>
|
|
Loading…
Reference in New Issue
Block a user