修改代码
This commit is contained in:
parent
d08d673781
commit
d50ee414ae
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/vuex/3.1.0/vuex.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/vue-router/3.0.6/vue-router.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/vue-router/3.1.2/vue-router.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.js"></script>
|
||||
|
||||
<script src="https://cdn.bootcss.com/element-ui/2.7.2/index.js"></script>
|
||||
|
@ -38,27 +38,27 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SidebarItem',
|
||||
props: {
|
||||
routes: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
isNest: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasOneShowingChildren(children) {
|
||||
const showingChildren = children.filter(item => {
|
||||
return !item.hidden;
|
||||
});
|
||||
if (showingChildren.length === 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
name: 'SidebarItem',
|
||||
props: {
|
||||
routes: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
isNest: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasOneShowingChildren(children) {
|
||||
const showingChildren = children.filter(item => {
|
||||
return !item.hidden;
|
||||
});
|
||||
if (showingChildren.length === 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -19,18 +19,18 @@ import { mapGetters } from 'vuex';
|
||||
import SidebarItem from './SidebarItem';
|
||||
|
||||
export default {
|
||||
components: { SidebarItem },
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'routers'
|
||||
]),
|
||||
routes() {
|
||||
return this.$router.options.routes;
|
||||
},
|
||||
isCollapse() {
|
||||
return !this.sidebar.opened;
|
||||
}
|
||||
}
|
||||
components: { SidebarItem },
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'routers'
|
||||
]),
|
||||
routes() {
|
||||
return this.$router.options.routes;
|
||||
},
|
||||
isCollapse() {
|
||||
return !this.sidebar.opened;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -234,7 +234,6 @@ export default {
|
||||
|
||||
await this.setWindowSize();
|
||||
await this.initLoadData();
|
||||
console.log(history);
|
||||
},
|
||||
async beforeDestroy() {
|
||||
await this.clearAllTimer();
|
||||
|
Loading…
Reference in New Issue
Block a user