2020-04-14 19:33:57 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="content-left left-slot" :class="{'left-slot-shrink':isShrink}">
|
|
|
|
|
<slot name="content-left"></slot>
|
|
|
|
|
<div @click="toggleStat" class="bottom-icon">
|
|
|
|
|
<div class="bottom-divider"></div>
|
2020-04-17 15:21:39 +08:00
|
|
|
<div style="display: inline-block;float: right;margin-right:15px;"><i style="font-size: 24px;" :class="{'nz-icon nz-icon-push-pin-line':isShrink,'nz-icon nz-icon-push-pin-fill':!isShrink}" :style="{color:!isShrink?'#EE9D3F':''}"></i></div>
|
2020-04-14 19:33:57 +08:00
|
|
|
</div>
|
2020-05-07 21:25:53 +08:00
|
|
|
</div><div class="content-right right-slot" :class="{'right-slot-open':isShrink}">
|
2020-04-14 19:33:57 +08:00
|
|
|
<slot name="content-right" ></slot>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
name: "leftMenu",
|
|
|
|
|
props:{
|
|
|
|
|
resizeFunc:{type:Function}
|
|
|
|
|
},
|
|
|
|
|
data(){
|
|
|
|
|
return{
|
2020-05-07 21:25:53 +08:00
|
|
|
isShrink: this.$store.state.leftMenuStat,
|
2020-04-14 19:33:57 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
|
|
|
|
toggleStat:function(){
|
|
|
|
|
this.isShrink=!this.isShrink;
|
|
|
|
|
this.$store.commit('setLeftMenuStat',this.isShrink);
|
|
|
|
|
if(this.resizeFunc){
|
|
|
|
|
this.resizeFunc();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.content{
|
|
|
|
|
height: 100%;
|
|
|
|
|
position:relative;
|
|
|
|
|
}
|
|
|
|
|
.slot-content{
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
.content .left-slot{
|
|
|
|
|
position: relative;
|
2020-04-17 15:21:39 +08:00
|
|
|
background-color: $left-menu-bgcolor;
|
2020-05-07 21:25:53 +08:00
|
|
|
transition: transform 200ms;
|
|
|
|
|
/*transition: width 200ms;*/
|
|
|
|
|
transform: scaleX(1);
|
|
|
|
|
transform-origin: left;
|
2020-04-14 19:33:57 +08:00
|
|
|
/*border-bottom: 1px solid #eeeeee;*/
|
|
|
|
|
/*transition: all 100ms;*/
|
|
|
|
|
}
|
|
|
|
|
.content .right-slot{
|
2020-05-07 21:25:53 +08:00
|
|
|
width: calc(100% - 200px);
|
|
|
|
|
}
|
|
|
|
|
.content .right-slot-open{
|
|
|
|
|
width: calc(100% - 46px);
|
|
|
|
|
margin-left: -154px;
|
2020-04-14 19:33:57 +08:00
|
|
|
}
|
|
|
|
|
.content .left-slot-shrink{
|
2020-05-07 21:25:53 +08:00
|
|
|
/*width: 25px;*/
|
|
|
|
|
transform: scaleX(0.25);
|
2020-04-14 19:33:57 +08:00
|
|
|
.bottom-icon .bottom-divider{
|
|
|
|
|
width: 0px;
|
|
|
|
|
}
|
|
|
|
|
.slot-content{
|
2020-05-07 21:25:53 +08:00
|
|
|
/*visibility: hidden;*/
|
|
|
|
|
opacity: 0;
|
2020-04-14 19:33:57 +08:00
|
|
|
}
|
|
|
|
|
}
|
2020-05-07 21:25:53 +08:00
|
|
|
.slot-content {
|
|
|
|
|
transition: opacity 200ms;
|
2020-04-14 19:33:57 +08:00
|
|
|
}
|
2020-05-07 21:25:53 +08:00
|
|
|
|
2020-04-14 19:33:57 +08:00
|
|
|
.left-slot .bottom-icon{
|
|
|
|
|
position:absolute;
|
|
|
|
|
bottom: 15px;
|
|
|
|
|
left: 0px;
|
|
|
|
|
}
|
2020-04-16 14:15:51 +08:00
|
|
|
.left-slot .bottom-icon i{
|
|
|
|
|
visibility: hidden;
|
|
|
|
|
}
|
2020-04-17 12:48:46 +08:00
|
|
|
.left-slot:hover{
|
2020-04-16 14:15:51 +08:00
|
|
|
i{
|
|
|
|
|
visibility: visible;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.left-slot .bottom-icon i:hover{
|
2020-04-14 19:33:57 +08:00
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
2020-04-16 14:15:51 +08:00
|
|
|
|
2020-04-14 19:33:57 +08:00
|
|
|
.bottom-icon .bottom-divider{
|
|
|
|
|
display: inline-block;
|
|
|
|
|
height: 1px;
|
|
|
|
|
width: 175px;
|
|
|
|
|
border-top: 1px solid lightgrey;
|
|
|
|
|
vertical-align: middle;
|
2020-04-16 14:15:51 +08:00
|
|
|
visibility: hidden;
|
2020-04-14 19:33:57 +08:00
|
|
|
}
|
|
|
|
|
.content .left-slot-shrink:hover{
|
2020-05-07 21:25:53 +08:00
|
|
|
/*width: 200px;*/
|
|
|
|
|
transform: scaleX(1);
|
|
|
|
|
/*padding: 0px 0px 0px 15px;
|
|
|
|
|
position: absolute;*/
|
2020-04-14 19:33:57 +08:00
|
|
|
z-index: 100;
|
|
|
|
|
.slot-content{
|
2020-05-07 21:25:53 +08:00
|
|
|
/*visibility: visible;*/
|
|
|
|
|
opacity: 1;
|
2020-04-14 19:33:57 +08:00
|
|
|
}
|
|
|
|
|
.bottom-icon{
|
|
|
|
|
z-index: 101;
|
|
|
|
|
}
|
|
|
|
|
.bottom-icon .bottom-divider{
|
|
|
|
|
width: 175px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
|
|
</style>
|