修改代码

This commit is contained in:
ival 2019-11-19 13:52:55 +08:00
parent d08d673781
commit d50ee414ae
4 changed files with 36 additions and 37 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -234,7 +234,6 @@ export default {
await this.setWindowSize();
await this.initLoadData();
console.log(history);
},
async beforeDestroy() {
await this.clearAllTimer();