One good way to handle these scenarios is to use a fluid v-container
on your main Nuxt entry point like this (default layout):
<template>
<v-app>
<v-main>
<v-container fluid>
<Nuxt /> <!-- Nuxt's entry point -->
</v-container>
</v-main>
</v-app>
</template>
And now every time you need a full-width section set the container's v-col
padding to zero (best is to use pa-0
or px-0
to be specific).
For example, inside my component I have:
<template>
<v-row class="image-background">
<v-col class="pa-0">
<v-container>
<v-row>
<v-col>
<h2 class="text-h2">Some Text</h2>
</v-col>
</v-row>
</v-container>
</v-col>
</v-row>
</template>
<style scoped>
.image-background {
background-image: url("/images/your-image.jpg");
background-size: cover;
background-repeat: no-repeat;
background-position: 50% 25%;
min-height: 35vh;
}
</style>
To create a full-width section add pa-0
class to it's column element (v-col
).
class of .image-background
simply adds an background image taking whole width of screen (since it is inside a fluid
container with no padding on it's v-col
parent).
Notice how I used another container (without fluid
attribute) to hold it's content in a responsive manner including it's paddings and media query breakpoints.
I am using Vuetify v2.6.1 and by the way if you're on a vanilla Vue environment this is the whole structure in one piece:
<template>
<v-app>
<v-main>
<v-container fluid>
<v-row class="some-class">
<v-col class="pa-0">
<!-- everything below will take full-width -->
<!-- unless inside another normal v-container -->
<img src="/path/to/image">
<!-- wrap other content inside another v-container -->
<v-container>
<v-row>
<v-col>
<h2 class="text-h2">Some Text</h2>
</v-col>
</v-row>
</v-container>
</v-col>
</v-row>
</v-container>
</v-main>
</v-app>
</template>