admin管理员组文章数量:1287652
I want to have a vuetify "temporary navigation drawer" with scaling width. The vuetify ponent es with 300px width by default, so I overrid it like so (using "Temporary" example)
<template>
<v-layout
wrap
style="height: 200px;"
>
<v-container>
<v-layout justify-center>
<v-btn
color="pink"
dark
@click.stop="drawer = !drawer"
>
Toggle
</v-btn>
</v-layout>
</v-container>
<v-navigation-drawer
v-model="drawer"
absolute
temporary
style="width: 13vw" //I change width to 13vw here
>
</v-navigation-drawer>
</v-layout>
</template>
The problem is, when the menu is not activated, it is hidden 300px to the left of the viewport. My scaling 13vw width, on larger displays, will bee larger than 300px, and therefore leave a sliver of the navigation menu unhidden in the left. How can I change the default hiding of the navigation menu?
Jsfiddle: / Zoom out with the navigation drawer unactivated to see what I'm talking about
I want to have a vuetify "temporary navigation drawer" with scaling width. The vuetify ponent es with 300px width by default, so I overrid it like so (using https://vuetifyjs./en/ponents/navigation-drawers "Temporary" example)
<template>
<v-layout
wrap
style="height: 200px;"
>
<v-container>
<v-layout justify-center>
<v-btn
color="pink"
dark
@click.stop="drawer = !drawer"
>
Toggle
</v-btn>
</v-layout>
</v-container>
<v-navigation-drawer
v-model="drawer"
absolute
temporary
style="width: 13vw" //I change width to 13vw here
>
</v-navigation-drawer>
</v-layout>
</template>
The problem is, when the menu is not activated, it is hidden 300px to the left of the viewport. My scaling 13vw width, on larger displays, will bee larger than 300px, and therefore leave a sliver of the navigation menu unhidden in the left. How can I change the default hiding of the navigation menu?
Jsfiddle: https://jsfiddle/agreyfield91/tgpfhn8m/957/ Zoom out with the navigation drawer unactivated to see what I'm talking about
Share Improve this question edited Aug 7, 2018 at 21:54 user7548189 asked Aug 2, 2018 at 2:14 user7548189user7548189 1,0166 gold badges18 silver badges32 bronze badges 3- try to use vw , it's relative to 1% of the width of the viewport – Chunbin Li Commented Aug 2, 2018 at 2:32
- If you can provide a jsfiddle or codepen that'd help – Matti Price Commented Aug 7, 2018 at 21:40
- Added jsfiddle. – user7548189 Commented Aug 7, 2018 at 21:54
1 Answer
Reset to default 8 +50So the vuetify ponent doesn't support using anything but pixels for the width
property of the ponent so you have two options. You can use the width
property with pixels instead. Or you can add a bit of a css hack to use vw instead.
Option 1: change your v-navigation-drawer
to the following:
<v-navigation-drawer
v-model="drawer"
absolute
temporary
width="500"
>
Option 2:
add this to your css
.v-navigation-drawer--close.v-navigation-drawer--temporary {
transform: translateX(-13vw) !important;
}
本文标签: javascriptVuetify navigation drawer issueStack Overflow
版权声明:本文标题:javascript - Vuetify navigation drawer issue - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741291850a2370596.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论