工欲善其事必先利其器

This commit is contained in:
2024-06-17 21:16:49 +08:00
parent 89baf6b8e4
commit 619530eb18
7 changed files with 79 additions and 129 deletions

View File

@@ -0,0 +1,46 @@
<script>
export default {
name: "appsNav",
data() {
return {
menu: []
}
},
created() {
this.menu = localStorage.getItem('routes') ? JSON.parse(localStorage.getItem('routes')) : []
}
}
</script>
<template>
<div class="appsNav">
<img src="../assets/logo.svg" class="logo"/>
<div class="item pointer" v-for="item in menu" :key="item.name" v-text="item.label" @click="$router.push({name: item.name})"/>
</div>
</template>
<style scoped>
.appsNav {
width: 200px;
height: 100vh;
background: #f3f6f9;
}
.item {
line-height: 32px;
border-top: 1px solid #ddd;
font-size: 14px;
font-weight: bold;
user-select: none;
padding: 0 16px;
}
.item:hover {
opacity: .8;
}
.logo {
width: 40px;
height: 40px;
margin: 10px calc(50% - 20px);
}
</style>

View File

@@ -1,26 +0,0 @@
<script>
export default {
name: "menu",
data() {
return {
menu: []
}
},
created() {
this.menu = localStorage.getItem('routes') ? JSON.parse(localStorage.getItem('routes')) : []
}
}
</script>
<template>
<div class="menu">
<div v-for="item in menu" :key="item.name" v-text="item.label" @click="$router.push({name: item.name})"/>
</div>
</template>
<style scoped>
.menu {
width: 200px;
height: 100vh;
background: #f3f6f9;
}
</style>