【发布时间】:2019-03-19 13:08:27
【问题描述】:
我找不到转到命名视图的解决方案。我的路线,
routes: [
{
path: '/',
component: App,
children : [
{
path: '/',
redirect: 'home'
},
{
path: 'home',
components: {
home : Home,
contact : Contact,
geo : Geo,
shake : Shake,
camera : Camera
}
},
]
}
]
这是我的 app.vue
...
<ion-fab vertical="bottom" horizontal="center" slot="fixed">
<ion-fab-button @click="page()">
<ion-icon name="camera"></ion-icon>
</ion-fab-button>
</ion-fab>
...
export default {
name : 'App',
methods: {
page() {
this.$router.push('home');
}
}
}
我想在单击相机图标/按钮时转到相机组件。我怎样才能做到这一点?
【问题讨论】:
-
你是如何定义你的
<router-view></router-view>的?
标签: ionic-framework vue.js vue-router