如何导航到 Framework7 + Vue 应用程序中的路线?
How to navigate to a route in Framework7 + Vue app?
如何在 Framework7 和 VueJs 应用程序中导航到路由。
我想显示 slpash 屏幕并在两秒后导航到下一页。代码贴在下面。
<template>
...
</template>
<script>
export default {
name: "splash",
mounted: function() {
this.$router.load({url: '/about/'}); // error
},
data: function () {
return {
msg : "hello"
}
}
}
</script>
注意:这是应用程序组件(Main.vue)。
最后这对我有用。
this.$f7.mainView.router.load({url: "/user-settings"})
来自文档
Please note, that $route and $router component properties are only available inside of custom page components (and their child components) that you load according to routes. In parent components (like in View, or where you init your Vue app instance) they are not accessible as your app may have few routers (Views) at a time. So in this case use access to initialized View Instance, e.g. $f7.views.main.router or $f7.mainView.router
如何在 Framework7 和 VueJs 应用程序中导航到路由。
我想显示 slpash 屏幕并在两秒后导航到下一页。代码贴在下面。
<template>
...
</template>
<script>
export default {
name: "splash",
mounted: function() {
this.$router.load({url: '/about/'}); // error
},
data: function () {
return {
msg : "hello"
}
}
}
</script>
注意:这是应用程序组件(Main.vue)。
最后这对我有用。
this.$f7.mainView.router.load({url: "/user-settings"})
来自文档
Please note, that $route and $router component properties are only available inside of custom page components (and their child components) that you load according to routes. In parent components (like in View, or where you init your Vue app instance) they are not accessible as your app may have few routers (Views) at a time. So in this case use access to initialized View Instance, e.g. $f7.views.main.router or $f7.mainView.router