大盘路由切换

This commit is contained in:
hh
2021-12-03 17:05:42 +08:00
parent fa1b1afb30
commit 7fac981048
6 changed files with 129 additions and 31 deletions

View File

@ -1,23 +1,26 @@
<template>
<div class="bigScreenBtn" :class="{selected:selected}">
<div>{{title}}</div>
</div>
<router-link :to="routerUrl">
<div class="bigScreenBtn" :class="{selected:this.$route.path == routerUrl}">
<div>{{title}}</div>
</div>
</router-link>
</template>
<script>
export default {
name: 'BigScreenBtn',
props: {
routerUrl: {
type: String,
default: '',
},
title: {
type: String,
default: '按钮',
},
selected: {
type: Boolean,
default: false,
},
},
data () {
return {
@ -44,7 +47,7 @@ export default {
background-image: url(./default.png);
}
.bigScreenBtn:hover {
opacity: .8;
opacity: 0.8;
}
.bigScreenBtn.selected {