You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.2 KiB
74 lines
1.2 KiB
|
3 years ago
|
<template>
|
||
|
|
<div class="right-menu-mask" @click="close()" @contextmenu.prevent="close()">
|
||
|
2 years ago
|
<div class="right-menu" :style="{'left':pos.x+'px','top':pos.y+'px'}">
|
||
|
|
<el-menu text-color="#333333">
|
||
|
|
<el-menu-item v-for="(item) in items" :key="item.key" :title="item.name"
|
||
|
2 years ago
|
@click.native.stop="onSelectMenu(item)">
|
||
|
2 years ago
|
<span :class="item.icon"></span>
|
||
|
3 years ago
|
<span>{{item.name}}</span>
|
||
|
2 years ago
|
|
||
|
3 years ago
|
</el-menu-item>
|
||
|
|
</el-menu>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
export default {
|
||
|
|
name: "rightMenu",
|
||
|
|
data() {
|
||
|
|
return {}
|
||
|
|
},
|
||
|
|
props: {
|
||
|
|
pos: {
|
||
|
|
type: Object
|
||
|
|
},
|
||
|
2 years ago
|
items: {
|
||
|
3 years ago
|
type: Array
|
||
|
|
}
|
||
|
|
},
|
||
|
2 years ago
|
methods: {
|
||
|
|
close() {
|
||
|
3 years ago
|
this.$emit("close");
|
||
|
|
},
|
||
|
2 years ago
|
onSelectMenu(item) {
|
||
|
2 years ago
|
this.$emit("select", item);
|
||
|
2 years ago
|
this.close();
|
||
|
3 years ago
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style lang="scss">
|
||
|
|
.right-menu-mask {
|
||
|
|
position: fixed;
|
||
|
|
left: 0;
|
||
|
|
top: 0;
|
||
|
|
right: 0;
|
||
|
|
bottom: 0;
|
||
|
|
width: 100%;
|
||
|
|
height: 100%;
|
||
|
|
z-index: 9999;
|
||
|
|
}
|
||
|
|
|
||
|
|
.right-menu {
|
||
|
|
position: fixed;
|
||
|
2 years ago
|
box-shadow: 0px 0px 10px #ccc;
|
||
|
|
|
||
|
|
.el-menu {
|
||
|
|
border: 1px solid #b4b4b4;
|
||
|
|
border-radius: 7px;
|
||
|
|
overflow: hidden;
|
||
|
3 years ago
|
|
||
|
2 years ago
|
.el-menu-item {
|
||
|
|
height: 40px;
|
||
|
|
line-height: 40px;
|
||
|
|
span {
|
||
|
|
font-weight: 600;
|
||
|
|
}
|
||
|
|
border-bottom: 1px solid #d0d0d0;
|
||
|
|
|
||
|
3 years ago
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
2 years ago
|
</style>
|