【发布时间】:2016-12-28 11:33:04
【问题描述】:
我有以下 index.html
<html>
....
<section id="#section">
<router-view></router-view>
</section>
</html>
在模板文件中,我在“/”处加载了以下内容
<div>
<a v-on:click="go()">GO</a>
</div>
<script>
export default {
methods: {
go: function () {
this.$router.go("/app")
}
}
}
</script>
我有以下路线图
route.map({
'/': {component: a},
"/app": {component:b}
})
route.start(a,"#section")
点击链接似乎不会改变视图。我不确定我做错了什么。
即使使用
route.map({'/': {component: a, subRoutes: { '/app': component: b }}}
好像没用。
【问题讨论】:
-
'/app': component: binroute.map({'/': {component: a, subRoutes: { '/app': component: b }}}不正确。
标签: vue.js vue-router vue-component