ModusCreateOrg / ModusCreateOrg/ionic-vue

Can't get tabs to work at all

Open
#146 7 comments 0 reactions 1 assignee View on GitHub

@michaeltintiuc is already working on this.

Since Aug 14, 2020.

question v2
Dominant language
TypeScript
Stars
268
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Sorry if I'm missing something obvious here. I'm trying to add a tab bar to my app (based on Vue 2) for the first time, and I just can't get it to work at all. I've looked through all the other issues I could find here relating to tabs, and tried various bits of code from them and the examples referenced by them, but I'm not even getting as far as having the issues they've encountered.

I've tried putting the template code for the tabs in both App.vue and Home.vue separately, as I couldn't find anything that says where that code is supposed to go, but it doesn't seem to make much difference either way for me. For the actual <ion-tab-button>s, I've tried with just the tab attribute alone, with the :to attribute set to a named route, and I've even tried a normal href attribute.

Whichever way I try it, the tab I click does get highlighted in the tab bar, but the URL never changes at all and it doesn't actually load anything. No errors (or messages of any sort) are output in my Chrome dev console either. I think it is actually switching to the matching <ion-tab> element though, because I noticed in some of my experiments with changing the content of one of the <ion-tab> elements, it actually went blank when I selected that tab. And then I also found when I tried with a longer page, it actually remembered a different scroll position for each tab (even though each tab is still displaying the same originally-loaded page).

What am I missing here? Is there perhaps something I need to set to enable <ion-tab-button>s to actually navigate to another page?

Or is there a complete example of how to implement tabs with the current (Vue 2) version of ionic-vue? I noticed one of the issues mentioned a "Cookbook" page, but that doesn't seem to exist anymore. I've been using @modus/ionic-vue@1.3.10, but I've also just updated to 1.3.12 and re-tried everything mentioned above, with the same results.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.