Error in Displaying Vuetify Child Router View

I am currently working on integrating a child router-view to be displayed alongside surrounding components.

Here is an overview of my routing setup:

{
    path: "/login",
    name: "TheLoginView",
    component: TheLoginView,
  },
  {
    path: "/dashboard",
    name: "TheDashboard",
    component: () => import("@/views/TheDashboard"),
    children: [
      {
        path: "",
        name: "DashboardView",
        component: () => import("@/components/dashboard/DashboardView"),
        children: [
          {
            name: "Place Order",
            path: "place-order",
            component: () => import("@/views/ThePlaceOrderView"),
          },
          {
            name: "Previous Orders",
            path: "Past-orders",
            component: () => import("@/components/ThePastOrders"),
          },
          {
            name: "Account Options",
            path: "account-options",
            component: () => import("@/components/TheAccountOptions"),
          },
        ],
      },
    ],
  },

The structure of my Dashboard component looks like this:

<template>
  <v-app>
    <DashboardAppBar />

    <DashboardNavDrawer />

    <DashboardView />

    <DashboardFooter />
  </v-app>
</template>

Currently, I am facing an issue where the DashboardView is being rendered below the navdrawer instead of beside it as expected.

Regardless of using v-app or v-content, the output remains consistent:

https://i.stack.imgur.com/YZUqI.png

Here is the current implementation of the DashboardView component:

<template>
  <router-view />
</template>

I'm at a loss regarding what modifications are needed to ensure that the child router-view displays next to the drawer.

Answer №1

After making some adjustments, I successfully resolved the issue by utilizing the 'app' prop for the components specified.

For instance, in my DashboardNavDrawer component, I included the 'app' prop as shown below:

<template>
  <v-navigation-drawer app class="deep-purple accent-4" dark permanent>
    <v-list>
      <v-list-item
        class="mx-2"
        v-for="(item, index) in mainMenuItems"
        :key="index"
        link
        :to="item.to"
      >
        <v-list-item-icon>
          <v-icon>{{ item.icon }}</v-icon>
        </v-list-item-icon>
        <v-list-item-content>
          <v-list-item-title>
            {{ item.name }}
          </v-list-item-title>
        </v-list-item-content>
      </v-list-item>
    </v-list>
  </v-navigation-drawer>
</template>

This adjustment has resulted in achieving the desired layout, resembling the screenshot provided: https://i.stack.imgur.com/2CaFy.png

I am grateful to YomS. for their helpful comment that led me to this solution!

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

Upon completing the build process, a blank white page appears when attempting to run it

I executed the yarn build command and received the dist folder. However, when I run the index.html, I encounter a blank white page. Directory Structure:- :~/Desktop/web$ ls babel.config.js docs node_modules public src yarn.lock ...

What is the best way to trigger a particular function only when a Vue component is called by a specific component, and not by any other components?

I've created a component called select-diagnosis that is utilized by various components. When select-diagnosis is invoked by a specific component known as PtdTreatment, it should execute a particular function within the fetchDiagnosis function. Howev ...

Error encountered: The fiber texture failed to load due to a component becoming suspended during the response to synchronous input

I'm encountering an issue while attempting to load a texture through the TextureLoader: const texture = useLoader(TextureLoader, '/textures/texture.png') The error message I receive from react is as follows: ERROR A component suspended w ...

What are the most effective ways to manage state in form components using React?

As I delve into the realm of best practices for managing state in React components, I find myself grappling with different approaches. Initially, I crafted a form by creating a TextField component structured like this: var TextField = React.createClass({ ...

Is requestAnimationFrame necessary for rendering in three.js?

I am currently working on the example provided in Chapter 2 of the WebGL Up and Running book. My goal is to display a static texture-mapped cube. The initial code snippet is not functioning as expected: var camera = null, renderer = null, scene = null ...

Barba.js (Pjax.js) and the power of replacing the <head> tag

I have been using barba.js to smoothly transition between pages without having to reload the entire site. If you want to see an example, take a look here. Here is a snippet of code from the example: document.addEventListener("DOMContentLoaded", func ...

Making sure to detect page refresh or closure using jQuery or JavaScript

Could there be a way to determine if a page has been refreshed or closed using jQuery or javascript? The current scenario involves having certain database values that need to be deleted if the user either refreshes or leaves the page. AJAX calls are bein ...

Obtaining data from a callback function within a NodeJS application

There is a function in my code that performs a backend call to retrieve an array of names. The function looks something like this: module.exports.getTxnList = function(index, callback) { ....some operations ..... .... callback(null, respon ...

The lifespan of my cookie is limited

I am utilizing the jQuery.min.js from https://github.com/carhartl/jquery-cookie and my cookie code looks like this: $(function() { //hide all divs just for the purpose of this example, //you should have the divs hidden with your css //check ...

Proper method for incorporating loading and error messages with the help of useContext and react hooks

Currently, I have a context.js file that makes an ajax call and stores the data in an array to be shared across components. While adding some 'loading ...' text during the loading process using axios, I feel there might be a better way to handle ...

Error encountered during VueJs build - Vuex-orm / plugin-axios integration

My VueJs application is built on Webpack 2. All the modules were installed successfully, but I encountered an error when trying to build the app: ERROR in ./~/@vuex-orm/plugin-axios/dist/vuex-orm-axios.esm-browser.js Module parse failed: node_modules/@vue ...

Unable to retrieve variable using the require statement

When attempting to access the variable 'app' from the required index.js in my test, I encounter difficulty resolving the 'app' variable. server.js 'use strict'; var supertestKoa = require('supertest-koa-agent'); ...

Issue with 'typename' in Vue Apollo's updateQuery causing undefined behavior

I am in the process of implementing a "Show More" button for my posts index. Initially, the index query loads smoothly with the first 5 posts. However, upon clicking the Show More button, I notice new posts being retrieved but encounter several errors like ...

The callback for the changed event in gulp fires ahead of the watch tasks

I'm having an issue with the sequence of tasks running in my file watching code. Although I have specified that the 'build-dev-mainjs' task should run first, followed by $.livereload.changed, it seems to be happening in the opposite order. ...

The function causes changes to an object parameter once it has been executed

I've encountered an issue with a function that is supposed to generate a string value from an object argument. When I call this function and then try to use the argument in another function, it seems to be getting changed somehow. Here is the code fo ...

Utilizing React Router: Combining MemoryRouter and Router for Dynamic Routing (leveraging memory for certain links while updating the URL for others)

While utilizing react-router-dom, I came across the helpful <MemoryRouter>. However, I am in need of having several routes that can read and write to/from the browser's URL. What is the best approach for implementing this functionality? Thank y ...

What is the process for inputting client-side data using a web service in ASP.NET?

Currently experimenting with this: This is my JavaScript code snippet: function insertVisitor() { var pageUrl = '<%=ResolveUrl("~/QuizEntry.asmx")%>' $.ajax({ type: "POST", url: pageUrl + "/inse ...

A guide on coding the source tag script for a payment form in CodeIgniter, specifically for a JavaScript form

Scenario: I have a variable called $data['tabdata'] that I am passing from controller C to view V. This variable includes a script element pointing to http://example.com/1.js. Problem: The script in 1.js is not running properly in the view. This ...

Activating Unsplash API to initiate download

I am currently following the triggering guidelines found in the Unsplash documentation. The endpoint I am focusing on is: GET /photos/:id/download This is an example response for the photo: { "id": "LBI7cgq3pbM", "width": ...

Listening on TCP port for HTML5 Websocket communications

I have a desktop application that is communicating with my asp.net mvc app. The desktop application publishes data on port:10000 which I need to be able to listen to in the browser. Below is the code snippet: <html> <head> <s ...