Commit 54e80fd3 by liang ce

router 判断

parent 8505a0aa
......@@ -47,7 +47,7 @@ export default {
created () {
let that = this
this.title = this.$route.meta.title ? this.$route.meta.title.split('/') : ''
this.defaultSelectedKeys = this.$route.matched[2].name ? this.$route.matched[2].name : ''
this.defaultSelectedKeys = this.$route.matched[2] && this.$route.matched[2].name ? this.$route.matched[2].name : ''
let data = {
item: 'e-card'
}
......@@ -60,7 +60,7 @@ export default {
watch: {
$route (to, from) {
this.title = to.meta.title.split('/')
this.defaultSelectedKeys = this.$route.matched[1].name ? this.$route.matched[1].name : ''
this.defaultSelectedKeys = this.$route.matched[1] && this.$route.matched[1].name ? this.$route.matched[1].name : ''
}
},
computed: {},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment