Commit 9860f1fa authored by tyn's avatar tyn

左侧菜单值绑定改为v-model

parent 28152a13
......@@ -2,7 +2,7 @@
<div class="feed-summary-container">
<div class="feed-summary-inner">
<div class="left-side-menu">
<project-side-menu ref="profitloss" :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="defaultActive" @select="select">
<project-side-menu ref="profitloss" :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" v-model="defaultActive" @select="select">
<template slot="盈亏分析对比-1">
<img src="@/assets/images/projectCostLedger/icon_cost_detail_7.svg" alt="">
<div class="project-sub-menu-title-text">盈亏分析对比</div>
......
......@@ -2,7 +2,7 @@
<div class="project-side-menu-container">
<el-menu mode="vertical" class="project-side-menu-instance" :unique-opened="uniqueOpened" :default-active="createMenuIndex(comDefaultActive)"
:default-openeds="comDefaultOpeneds" @select="menuSelect" @open="subMenuOpen" @close="subMenuClose" ref="customElMenu">
<template v-for="(item,index) of tempMenuTree">
<template v-for="(item, index) of tempMenuTree">
<project-menu-item :menuItem="item" :key="`${item.nodeValue}-${item.level}`">
<template :slot="`${item.nodeName}-${item.level}`" slot-scope="scope">
<slot :name="`${scope.data.nodeName}-${scope.data.level}`" :data="scope.data"></slot>
......@@ -20,6 +20,10 @@ export default {
components: {
ProjectMenuItem
},
model: {
prop: "defaultActive",
event: "update:defaultActive"
},
props: {
// 菜单树形结构对象
menuTree: {
......@@ -142,6 +146,7 @@ export default {
this.$emit("close", menuPath, menuPathArray);
},
menuSelect(menuPath) {
this.$emit("update:defaultActive", menuPath);
if (this.comDefaultActive == menuPath) return;
const result = this.getCurrentData(menuPath);
this.$emit("select", menuPath, result);
......@@ -250,7 +255,7 @@ export default {
}
}
},
}
};
</script>
<style lang="scss" scoped>
.project-side-menu-container {
......@@ -266,9 +271,10 @@ export default {
/* 重置一级二级菜单 高度行高 */
.project-menu-item-container {
/* 有下级菜单 */
.project-sub-menu-item {
& > .el-submenu__title {
&>.el-submenu__title {
height: 32px;
line-height: unset;
display: flex;
......@@ -292,7 +298,7 @@ export default {
text-overflow: ellipsis;
}
& > img {
&>img {
width: 16px;
height: 16px;
margin-right: 4px;
......@@ -310,11 +316,9 @@ export default {
&:hover {
background-color: unset;
background: linear-gradient(
91deg,
rgba(0, 129, 255, 0.1) 0%,
rgba(0, 129, 255, 0) 100%
);
background: linear-gradient(91deg,
rgba(0, 129, 255, 0.1) 0%,
rgba(0, 129, 255, 0) 100%);
}
}
}
......@@ -340,11 +344,10 @@ export default {
&.is-active {
.project-only-menu-title-container {
background-color: unset;
background: linear-gradient(
91deg,
rgba(0, 129, 255, 0.1) 0%,
rgba(0, 129, 255, 0) 100%
);
background: linear-gradient(91deg,
rgba(0, 129, 255, 0.1) 0%,
rgba(0, 129, 255, 0) 100%);
.project-only-menu-title {
color: #0081ff;
}
......@@ -369,11 +372,9 @@ export default {
&:hover {
background-color: unset;
background: linear-gradient(
91deg,
rgba(0, 129, 255, 0.1) 0%,
rgba(0, 129, 255, 0) 100%
);
background: linear-gradient(91deg,
rgba(0, 129, 255, 0.1) 0%,
rgba(0, 129, 255, 0) 100%);
}
.project-only-menu-title {
......@@ -392,7 +393,7 @@ export default {
text-overflow: ellipsis;
}
& > img {
&>img {
width: 16px;
height: 16px;
margin-right: 4px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment