🐛(menu): 修复 menu 组件 mored 图标不随状态变化
This commit is contained in:
parent
28fe83c02d
commit
ea06a05198
@ -309,8 +309,3 @@
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.layui-nav-child-spacing .layui-nav-item .layui-nav-child {
|
||||
padding-left: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ import {
|
||||
Ref,
|
||||
ref,
|
||||
watch,
|
||||
WritableComputedRef,
|
||||
} from "vue";
|
||||
import "./index.less";
|
||||
|
||||
@ -25,7 +24,6 @@ export interface LayMenuProps {
|
||||
level?: boolean | string;
|
||||
collapse?: boolean | string;
|
||||
collapseTransition?: boolean | string;
|
||||
childSpacing?: boolean;
|
||||
}
|
||||
|
||||
const emit = defineEmits([
|
||||
@ -43,8 +41,7 @@ const props = withDefaults(defineProps<LayMenuProps>(), {
|
||||
inverted: false,
|
||||
level: true,
|
||||
collapse: false,
|
||||
collapseTransition: true,
|
||||
childSpacing: false,
|
||||
collapseTransition: true
|
||||
});
|
||||
|
||||
const isTree: ComputedRef = computed(() => props.tree);
|
||||
@ -102,8 +99,7 @@ provide("isCollapseTransition", isCollapseTransition);
|
||||
inverted ? 'inverted' : '',
|
||||
tree ? 'layui-nav-tree' : '',
|
||||
theme === 'dark' ? 'layui-nav-dark' : 'layui-nav-light',
|
||||
collapse ? 'layui-nav-collapse' : '',
|
||||
childSpacing ? 'layui-nav-child-spacing' : '',
|
||||
collapse ? 'layui-nav-collapse' : ''
|
||||
]"
|
||||
>
|
||||
<slot></slot>
|
||||
|
@ -89,14 +89,17 @@ onBeforeUnmount(() => window.removeEventListener("resize", setPosition));
|
||||
<template>
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:void(0)" @click="openHandle()">
|
||||
<!-- 图标 -->
|
||||
<i>
|
||||
<slot v-if="slots.icon" name="icon"></slot>
|
||||
</i>
|
||||
<!-- 标题 -->
|
||||
<span>
|
||||
<slot v-if="slots.title" name="title"></slot>
|
||||
</span>
|
||||
<!-- 扩展 -->
|
||||
<i
|
||||
:class="[isOpen && !isTree ? 'layui-nav-mored' : '']"
|
||||
:class="[isOpen ? 'layui-nav-mored' : '']"
|
||||
class="layui-icon layui-icon-down layui-nav-more"
|
||||
></i>
|
||||
</a>
|
||||
|
@ -37,7 +37,7 @@ export const usePlayGround = async (
|
||||
code = `${decodeCode}
|
||||
<script lang="ts" setup>
|
||||
|
||||
</script>`
|
||||
</script>`;
|
||||
}
|
||||
|
||||
// 去除 export default,保留其中的内容
|
||||
|
Loading…
Reference in New Issue
Block a user