feat: add function of async router and async menu; 🌟

新增:异步路由和菜单功能;
This commit is contained in:
iczer
2020-07-29 11:08:01 +08:00
parent a4764d880d
commit bfb0358217
36 changed files with 614 additions and 450 deletions

View File

@@ -7,7 +7,7 @@
<h1>{{config[type].title}}</h1>
<div class="desc">{{config[type].desc}}</div>
<div class="action">
<a-button type="primary" >返回首页</a-button>
<a-button type="primary" @click="backHome">返回首页</a-button>
</div>
</div>
</div>
@@ -18,11 +18,19 @@ import Config from './typeConfig'
export default {
name: 'ExceptionPage',
props: ['type'],
props: ['type', 'homeRoute'],
data () {
return {
config: Config
}
},
methods: {
backHome() {
if (this.homeRoute) {
this.$router.push(this.homeRoute)
}
this.$emit('backHome', this.type)
}
}
}
</script>