提交 987c3918 编写于 作者: RedPig97's avatar RedPig97

优化快捷菜单组件---fix3

上级 9b341097
.app-quick-menus{ .app-quick-menus{
display: flex; display: flex;
.menuIcon{ .el-card{
padding: 4px; margin-left: 16px;
padding-bottom: 10px; .el-card__body{
display: flex; padding: 0;
width: 140px; width: 200px;
height: 80px; height: 122px;
border: 1px #70C0F5 solid; border: 1px rgb(210,238,255) solid;
border-radius: 3px; border-radius: 3px;
align-items: center; margin: 0;
margin: 0; background-color: rgb(240,249,255);
background-color: #C0E3FA; &:hover{
justify-content: space-around; border-color: rgb(53,152,220) !important;
flex-direction: column; }
span{ .menuIcon{
font-size: 40px; width: 100%;
} height: 100%;
img{ display: flex;
width: 30px; justify-content: center;
height: 30px; flex-direction: column;
} align-items: center;
h4{ span{
font-weight: 500; font-size: 40px;
}
img{
width: 46px;
height: 46px;
// margin-top: 12px;
}
h4{
font-weight: 500;
font-size: 16px;
}
}
} }
} }
} }
<template> <template>
<div class="app-quick-menus"> <div class="app-quick-menus">
<template v-for="(item,index) in menus"> <template v-for="(item,index) in menus">
<card :bordered="false" v-if="item.items && Array.isArray(item.items)" :key="index"> <div :bordered="false" v-if="item.items && Array.isArray(item.items)" :key="index">
<p slot="title" @click="$emit('menuClick',item.name, [item.name])"> <p @click="$emit('menuClick',item.name, [item.name])">
<span style="margin-right:12px">
<img :src="item.icon" v-if="!Object.is(item.icon, '')" />
<img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" />
<i class="fa fa-cogs" v-else></i>
</span>
<span>{{$t('app.menus.' + ctrlName + '.' + item.name)}}</span> <span>{{$t('app.menus.' + ctrlName + '.' + item.name)}}</span>
<span class="line"></span> <span class="line"></span>
</p> </p>
<p style=" display: 'flex' "> <p style=" display: 'flex' ">
<app-quick-menus :menus="item.items" :ctrlName = "ctrlName"></app-quick-menus> <app-quick-menus :menus="item.items" :ctrlName = "ctrlName" @menuClick="menuClick"></app-quick-menus>
</p> </p>
</card> </div>
<card <el-card
:key="index" :key="index"
:style=" { shadow="never"
width:'140px',
height: '80px',
wordBreak: 'break-all',
cursor: 'pointer',
marginLeft: '20px',
border:'0',
padding:'0',
display: 'flex',
alignItems: 'center'
}"
:padding="0"
v-else v-else
> >
<div @click="$emit('menuClick',item.name, [item.name])" class="menuIcon"> <div @click="menuClick(item.name,[item.name])" class="menuIcon">
<span> <span>
<img :src="item.icon" v-if="!Object.is(item.icon, '')" /> <img :src="item.icon" v-if="!Object.is(item.icon, '')" />
<img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" /> <img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" />
...@@ -39,7 +24,7 @@ ...@@ -39,7 +24,7 @@
</span> </span>
<h4>{{$t('app.menus.' + ctrlName + '.' + item.name)}}</h4> <h4>{{$t('app.menus.' + ctrlName + '.' + item.name)}}</h4>
</div> </div>
</card> </el-card>
</template> </template>
</div> </div>
</template> </template>
...@@ -49,6 +34,11 @@ import { Component, Vue, Prop, Model, Watch } from "vue-property-decorator"; ...@@ -49,6 +34,11 @@ import { Component, Vue, Prop, Model, Watch } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppQuickMenus extends Vue { export default class AppQuickMenus extends Vue {
public menuClick(index: any,indexs: any[]) {
this.$emit("menuClick",index,indexs);
}
/** /**
* 菜单数据 * 菜单数据
* *
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册