I try to test v-container full-width or center by set fluid="false" but not working. How to do it?
<v-app>
<v-navigation-drawer></v-navigation-drawer>
<v-toolbar></v-toolbar>
<main>
<v-container fluid="isFullWidth">
<router-view></router-view>
</v-container>
</main>
<v-footer></v-footer>
</v-app>
<script>
export default {
data () {
return {
isFullWidth: false,
}
}
}
</script>
:fluid="false"
Not work. It's alway display full width
Seems that the attribute does not take values, but simply passes all the attributes to classes
https://github.com/vuetifyjs/vuetify/blob/b4742ec9f53c7be140c36b3d4d22a30d2ea0308b/src/components/grid/index.js#L15-L18
It's work but so long I think that it's need better solution.
<v-container ref="container">
if (width == "FULL_WIDTH") {
console.log('FULL WIDTH CONTENT')
this.$refs.container.setAttribute("fluid", true)
this.$refs.container.setAttribute("class", "pa-0")
} else {
console.log('CENTER CONTENT')
this.$refs.container.removeAttribute("fluid")
}
use <v-container v-bind="{ fluid: isFullWidth } ">
Thanks @johnleider , I tried, but It's not work. Did you test it?
https://codepen.io/cawa-93/pen/zdzqrV?editors=1010#0
<v-container :class="{fluid: isFullWidth}">
Most helpful comment
use
<v-container v-bind="{ fluid: isFullWidth } ">