Commit 54e80fd3 by liang ce

router 判断

parent 8505a0aa
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
created () { created () {
let that = this let that = this
this.title = this.$route.meta.title ? this.$route.meta.title.split('/') : '' 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 = { let data = {
item: 'e-card' item: 'e-card'
} }
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
watch: { watch: {
$route (to, from) { $route (to, from) {
this.title = to.meta.title.split('/') 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: {}, 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