一、Ionic5 Vue3普通路由跳转
Icon组件演示
toolbar组件演示
ion-back-button中default-href可以配置没有路由的时候返回的页面
新闻列表
二、Ionic5 Vue3路由跳转传值
Get传值
this.$route.query
Get传值
import { useRoute } from 'vue-router';
export default defineComponent({
...
setup() {
const route = useRoute();
const { id } = route.query;
return { id };
}
})
三、Ionic5 Vue3路由编程式导航(Js跳转路由)
this.$router.push({ path: 'news' })
this.$router.push({
path: '/newsContent/495'
});
this.$router.push({ path: '/newscontent', query:{aid:14} }
this.$router.push({ path: '/newscontent/123'})
四、Ionic5 Vue中通过router返回上一页
router.back()
router.go(-1)
import { useRouter } from 'vue-router';
setu