vue+el 实现 阶梯效果

  • vue+el 实现 阶梯效果已关闭评论
  • 116 次浏览
  • A+
所属分类:Web前端
摘要

[简介]:关键代码;
<el-row class=’midPart’ style=”>{{ menu.name }}</el-row>
.midPart {
float: left;
width: 4%;
padding: 7px 7px;
background: #444;
}

[简介]:

关键代码;
<el-row class='midPart' style=''>{{ menu.name }}</el-row>
.midPart {
float: left;
width: 4%;
padding: 7px 7px;
background: #444;
}

[内容]:

<template>
<div id="MidMenu">
<div ref='midMenu' class='midMenu'>
<router-link v-for='(menu,key) in midMenus' :key='key' :to='menu.link' :title='menu.title' class='midMenus'>
<el-row class='midPart' style=''>{{ menu.name }}</el-row>
</router-link>
</div>
</div>
</template>

<script>
export default {
name: 'MidMenu',

data() {
return {
path: this.$route.path,
midMenus: [
{link: '/', name: '散记', title: '散记'},
{link: '/', name: '编程', title: '编程'},
{link: '/', name: '数学', title: '数学'},
{link: '/', name: '天文', title: '天文'},
{link: '/', name: '物理', title: '物理'},
{link: '/', name: '化学', title: '化学'},
{link: '/', name: '生物', title: '生物'},
{link: '/', name: '文学', title: '文学'},
{link: '/', name: '艺术', title: '艺术'},
],

}
},
created() {
},
methods: {
}
}
</script>

<style>
#MidMenu {
color: white;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

.midMenu {
margin-top: -30px;
text-align: center;
}

.midMenus {
padding: 2px;

}

.midPart {
float: left;
width: 4%;
font-size: 15px;
padding: 7px 7px;
color: dodgerblue;
background: #444;
}

.midPart:hover {
color: white;
background: cornflowerblue;
}

</style>

 

[说明]:偶然间发现 。

[个人博客]:-- 创意时空-散记详情 (codeworld.fun)


明月几时有?把酒问青天。不知天上宫阙,今夕是何年。我欲乘风归去,又恐琼楼玉宇,高处不胜寒。起舞弄清影,何似在人间。
转朱阁,低绮户,照无眠。不应有恨,何事长向别时圆?人有悲欢离合,月有阴晴圆缺,此事古难全。但愿人长久,千里共婵娟。