What is the process for integrating ion-tabs with IonicVueRouter within an Ionic (vue.js) application?

My Project Idea

I have a vision to create an innovative exercise warm-up application. The app will be divided into two main sections: a workout tab and a settings tab. The user journey will start with selecting a workout plan, then choosing specific exercises, followed by inputting the weight for each exercise to generate a customized warm-up routine.

All the components required for these functionalities are currently operational and seamlessly connected in a linear progression.

Goal of the Project

My objective is to introduce tabbed navigation within the app interface. This feature would allow users to easily switch between the settings section and the workout section using designated tabs labeled as 'Settings' and 'Workout.'

Check out the app flow here

The Challenge I am Facing

After integrating ion-tabs into the application, the main tab buttons properly display the intended components (ChooseWorkout.vue and Settings.vue) upon selection. However, a critical issue arises where the router functionality stops working correctly. As a result, navigating from ChooseWorkout.vue to ChooseLifts.vue leads to a blank screen, even though the tab indicators at the bottom of the app remain visible.

The URL structure during this transition is noted as http://localhost:8080/#/lifts/StrongLifts%205x5 (prior to ion-tabs integration, only was utilized in main.js).

Key Code Snippets

App.vue

<template>
    <div id="app">
        <ion-app>
            <ion-tabs>
                <ion-tab tab="workout">
                    <ion-vue-router />
                </ion-tab>
                <ion-tab tab="settings">
                    <Settings />
                </ion-tab>
                <template slot="bottom">
                    <ion-tab-bar>
                        <ion-tab-button tab="workout">
                            <ion-icon name="body-outline" />
                            <ion-label>Workouts</ion-label>
                        </ion-tab-button>
                        <ion-tab-button tab="settings">
                            <ion-icon name="body-outline" />
                            <ion-label>Settings</ion-label>
                        </ion-tab-button>
                    </ion-tab-bar>
                </template>
            </ion-tabs>
        </ion-app>
    </div>
</template>
COPY TO CLIPBOARD    SELECT ALL

ChooseWorkout.vue

<template>
  <ion-page>
    <ion-header>
      <ion-toolbar color="primary">
        <ion-title>Choose Workout</ion-title>
      </ion-toolbar>
    </ion-header>
    <ion-content padding>
      <ion-list>
        <div v-for="workout in workouts" v-bind:key="workout">
            <ion-item>
                <ion-label>
                    <h1>{{workout.name}}</h1>
                    <p>{{workout.by}}</p>
                </ion-label>
                <router-link :to="{path:`lifts/${workout.name} `}">
                    <ion-button>Select</ion-button>
                </router-link>
            </ion-item>
        </div>
      </ion-list>
    </ion-content>
  </ion-page>
</template>

<script>
import { add } from "ionicons/icons";
import { addIcons } from "ionicons";

addIcons({
  "ios-add": add.ios,
  "md-add": add.md
});

export default {
    name: 'ChooseWorkout',
    data() {
        return {
            workouts: [
                {name: 'Starting Strength', by: 'Mark Rippetoe'},
                {name: 'StrongLifts 5x5', by: 'Mehdi'},
                {name: 'GreySkull LP', by: 'John Sheaffer'},
                {name: 'Max Single', by: 'n/a'}
            ]
        }
    },
    methods: {
    }
};
</script>

<style scope></style>

main.js


const router = new IonicVueRouter({
  routes: [
    {
      path: "/",
      redirect: "/workout"
    },
    {
      path: "/settings",
      name: "settings",
      component: Settings
    },
    {
      path: "/workout",
      component: ChooseWorkout
    },
    {
      path: "/lifts/:workout",
      component: ChooseLifts
    },
    {
      path: "/lifts/:workout/:excercise",
      component: ChooseWeight
    },
  ]
});

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When trying to convert a function component to a class component, using `npm init react-app` may result in the error `ReferenceError: React is not defined no-undef`

After running npm init react-app appname, I noticed that the file App.js was created, containing a function component: function App() { return ( <SomeJSX /> ); } I decided to change this function component into a class component like this: c ...

Creating a seamless integration between a multi-step form in React and React Router

I've been learning how to use React + ReactRouter in order to create a multi-step form. After getting the example working from this link: , I encountered an issue. The problem with the example is that it doesn't utilize ReactRouter, causing the ...

Difficulty accessing Vue data passed from parent to child component

In my app.vue file, I have the parent code for a Vue app. <template> <div id="app" class="small-container"> <h1>Employees</h1> <employee-form @add:employee="addNewEmployee" /> <employee-table :employees="empl ...

What causes the discrepancy in the expiresIn value of my JWT when it is transmitted from the server to the front-end?

After setting the token expiry date on the server, I decided to log out the value to double-check it. However, upon checking the value on my React front-end, I noticed a significant change in the value received compared to what was sent from the server. Is ...

Error encountered during navigation: navigator has not been defined

I encountered an issue where the page gets redirected upon form submission without triggering the catch block. However, in the backend, I am facing an error stating that the API body is not being executed. Below is the code snippet of the page: "use cl ...

Encountering issues with integrating NPM package into Meteor.js

Having installed both the meteor-npm package and the crypto npm package, I encountered some issues while using it in Meteor. npm: updating npm dependencies -- crypto Despite seeing this output in the console, when trying to use the npm package on the ser ...

ways to validate the calling function in jquery

One of the challenges I'm facing is identifying which function is calling a specific error function that is used in multiple places within my code. Is there a method or technique to help determine this? ...

Exploring the Shopware 6 Admin API: Saving a new entity with a default entity property

How can I set a default value for a new entity property (such as defaultCurrency.id) within the sw-entity-single-select component before calling this.repository.save()? Is this possible, or do I have to wait until after calling save() and then listen for ...

Language translation API specifically designed to convert text content excluding any HTML formatting

I have a dilemma with translating text content in an HTML file into multiple languages based on user input. To accomplish this, I am utilizing the Microsoft Translator AJAX interface. The structure of my HTML file looks something like this; <h1>< ...

What is the best way to update information in a mongoose document using the _id field?

Although it may sound like a typical question, I've already conducted research and couldn't find a solution. I'm currently working on developing a discord bot and I don't have much experience in this area. The issue I keep encountering ...

Fill input text fields with values based on dropdown selection and start with 2 input fields pre-filled

Initially, the issue is that there are 2 input text fields displayed. Depending on the selection from a drop-down menu ranging from 2 to 6, additional input fields should be added or removed. Here's my code: function addElements(selectElement) { va ...

Having trouble uploading custom fonts to my Vue application using SASS

Currently utilizing the sass loader in my vue app (using vue CLI 3) for styling. However, I encountered an error when attempting to load local fonts in one of my scss files, stating "This relative module was not found." To simplify things, I placed my font ...

Tips for integrating Material UI Drawer with Redux

I have been attempting to incorporate a Drawer feature that displays on the left side while utilizing Redux to maintain the state of the Drawer. Unfortunately, I seem to have made an error as my onClick events are not responsive. Here is the code: Reduce ...

Incorporating text interpolation successfully within CSS functions and router links

My goal was to create a versatile card component that could be easily reused. I wanted the cards to dynamically display different images and links based on certain properties. While I successfully implemented the title functionality, I encountered an iss ...

Using Typescript to pass a property as one of the keys in an object's list of values

In my React Native project, I need to pass a string value from one component to another. The different options for the value can be found in the ScannerAction object: export const ScannerAction = { move: 'move', inventory: 'inventory&apo ...

Enhancing Grails dynamic dropdown to include a pre-selected value in edit.gsp

One feature I have implemented is a dynamic dropdown menu in my _form.gsp file that appears in both the create and edit pages. While it currently works as intended, I am seeking a way to display the selected value on the edit page. _form.gsp <g:s ...

Contrasting the use of jQuery versus AJAX for updating static page text

While I haven't fully grasped the concept of AJAX yet, my understanding is that it can be beneficial for updating specific parts of a webpage. Does using AJAX only make sense when you require server interaction? I am looking to replace text on a webp ...

Applying CSS styles to a page depending on certain conditions

Currently, I have a page in SharePoint that can function as a pop-up. I am using JavaScript to identify whether it is a pop-up by checking if window.location.search.match("[?&]IsDlg=1"). However, I am struggling to figure out how to insert CSS based on ...

Show the item in the menu with a label that has either subscript or superscript styling

Within the realm of electrons, the application menu is specified: const menuTemplate = [ { label:"Menu Item 1", click(){ //define some behavior } } ]; Is there a method to exhibit the name of the menu item as Me ...

Verifying that the code runs only once the changes to a monitored property have been successfully implemented in the user interface

When working with AngularJS, how can one ensure that code is executed only after a change to a watched property has fully taken effect in the UI? For instance, imagine that the visibility of a loading indicator is tied to the value of an isLoading propert ...