清理一下
This commit is contained in:
26
src/components/menu.vue
Normal file
26
src/components/menu.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user