Place the component above the fixed app.vue file

I am currently dealing with a split layout, as shown in the example screens below. The default setup has the fixed app Vue content occupying 40% of the left interface, while the router view takes up the remaining 60% on the right side.

However, I have encountered an issue where one of the components (specifically, router link 3) needs to be displayed in fullscreen mode. Unfortunately, I am facing difficulty in making the router component overlap the app Vue content as it always appears beneath it.

Router link 1: https://i.sstatic.net/VCtUv.png

Router link 2: https://i.sstatic.net/akbhZ.png

Router link 3: https://i.sstatic.net/eZij6.png

Below is my current code structure:

app.vue:

<template>
<div class="left">
  <router-link to="/link1">
  <router-link to="/link2">
  <router-link to="/link3">
</div>

// some content

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

<style>
.left {
  width: 40%;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
</style>

Component 1 and 2:

<template>
  <div class="container">
  // same content
  </div>
</template>
<style>
.container {
  display: inline-block;
  margin-left: 40%;
  width: 60%;
  height: 100vh;
}
</style>

Component 3:

<template>
  <div class="container">
  // same content
  </div>
</template>
<style>
.container {
  display: inline-block;
  width: 100%;
  height: 100vh;
}
</style>

Answer №1

To achieve the desired effect for component3, consider utilizing the CSS property "position: absolute". In addition, adjust the z-index to ensure it is displayed on top of other elements. Here's an example:

<template>
  <div class="container">
  // add your content here
  </div>
</template>

<style>
.container {
  display: inline-block;
  position: absolute;
  z-index: 150;
  width: 100%;
  height: 100vh;
}
</style>

Answer №2

Another way is to utilize the v-bind class attribute in order to assign a class to an existing component within the page, resulting in a similar outcome as observed in WYSIWYG editors with the full-page option.

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

What is the best way to ensure buttons remain on the same line in Vue.js?

In a table, I have three buttons that are placed on top of each other when the data in the row is too long and expands the table. My goal is to keep these three buttons in one line regardless of the content length. <td class="text-xs-right"> <d ...

What is the appropriate title for the css class?

When creating a stylesheet for a website, should the CSS style names be related to the website or its content? For example, if my website is about web development, would it be correct to use style names like: #web-development-header .web-development-comp ...

Tips for concealing boostrap spinners

Within the main component, I have an @Input() alkatreszList$!: Observable<any[]>; that gets passed into the child component input as @Input() item: any; using the item object: <div class="container-fluid"> <div class="row ...

CSS: Make the box width fit the text content

I'm looking to make the width of the box adjust to the text inside it Here is the HTML code snippet: <span class="box">Testing content of the box</span> And here is the CSS code snippet: .box { padding-left:5px; padding-right:5 ...

Trouble getting CSS transition to work with underline decoration

I am currently working with CSS to apply an underline effect underneath a span element: CSS: .un { text-decoration: none; transition: all .5s ease-in; } .un:hover { text-decoration: underline; } HTML: <span class="un"> Underlined Text ...

Issue encountered when attempting to switch the style of a header element from an HTML h3 tag to an h

One of the challenges I'm facing involves an HTML h3 tag, as shown below: <div class="centrar"> <h3>Lorem ipsum dolor!</h3> </div> I attempted to change it to an H4 using CSS, but unfortunately, my efforts have been u ...

Undefined variable 'site' error encountered in Codeigniter views

Query: I encountered an issue while running the program: undefined variable "site" in the views. The code snippet is as follows: <ul class="nav nav-pills"> <li><a href="<?php echo $site ?>/CI_timeline/index"& ...

Is there a way to insert a record upon the user clicking on the Add Record button?

// Here is my Component code // I want to figure out how to add a new row to the table with fresh values. import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-uom', templateUrl: './uom.component.html ...

Mobile viewing causing problems with website buttons functionality

While my website functions perfectly on desktop, I am facing an issue where the buttons are not working when accessed through mobile devices. Interestingly, these buttons were operating fine in a previous version of the site. Although I have made minimal ...

Why is it important to incorporate the CSS property background-repeat: repeat; into our code?

It is believed that if you don't expressly mention the background-repeat in CSS styling, browsers will automatically set it as background-repeat: repeat. With this default behavior in place, one might wonder why there is even a need for a separate ba ...

Ways to avoid grid items from overlapping with continuous text

import React from 'react'; import './style.css'; import Container from '@mui/material/Container'; //import Grid from '@mui/material/Unstable_Grid2'; // Grid version 2 import Grid from '@mui/material/Grid'; ...

Complete the transparent logo by showing the progress of the page loading

I am pondering the idea of filling in a logo based on the percentage of the page load. My initial thoughts are to use a gif, but I wonder if syncing a gif with the % of page load is really possible. Another idea is to have 100 images that change out depen ...

What is causing the parse error in my CSS code?

Running into a parse error on line 314 of my css (style.css). The error is "} expected css(css-rcurlyexpected)". Even after adding the necessary curly brace, it still doesn't validate. Below is my CSS starting from line 314 till the end: /* CSS code ...

Python KeyError: Implementing a Strategy for Displaying Two Divs Side by Side Efficiently with Dynamic Data

media.py: http://pastebin.com/r1nxPzTQ This file contains a Python class with methods like __init__ and show_trailer(self). fresh_tomatoes.py: http://pastebin.com/bcdUYiiu It's a Python script that generates an HTML file and populates it using data ...

Changing position of element upon appearance of span in React

Currently, I am working with React and facing an issue where a span element appears whenever a user hovers over a text element. The problem is that the existing text shifts leftwards when the span appears (to the right of the text). The desired behavior ...

Endless spinning using snap.svg

How do I make an SVG element rotate endlessly? Is there a way to make it rotate continuously without stopping? While Snap provides a way to rotate an SVG element by a specific amount, I want to know how to create an infinite rotation effect. Is there a so ...

Unlock the potential of vue-datepicker by harnessing the power of multiple calendars

Currently, I am implementing the Composition API and utilizing the Vuepic/vue-datepicker library. However, I have encountered an issue with my datepicker setup. The code for my datepicker is as follows: <Datepicker multi-calendars multi-calendars-so ...

Utilizing SASS, JavaScript, and HTML for seamless development with Browser Sync for live syncing and

I've been on a quest to find a solution that covers the following requirements: Convert SASS to CSS Post-process CSS Minify CSS Move it to a different location Bundle all Javascript into one file Create compatibility for older browsers Tre ...

Increase or decrease values in an input field using Vue3 when typing

I am looking to implement a feature where users can input numbers that will be subtracted from a fixed total of 100. However, if the user deletes the input, I want the difference to be added back to the total of 100. Despite my attempts, the subtraction wo ...

Transforming CSS with React Router Links

Why is my CSS being significantly altered by the React Router Link? Is there a way to prevent the Link from affecting the styling? Without Link: https://i.sstatic.net/ZoVEq.jpg With Link: https://i.sstatic.net/84qRS.jpg This is the code for the ...