admin管理员组文章数量:1429953
I'm trying to achieve to have my navigation drawer with expand-on-hover
property true if i'm on desktop and show the classic v-app-bar-nav-icon
if I'm on smaller screens or mobile.
I have done this but the behaviour is kinda weird:
<v-app-bar-nav-icon
v-if="!drawer"
@click="drawer = true"
></v-app-bar-nav-icon>
<v-navigation-drawer
app
dark
:expand-on-hover="$vuetify.breakpoint.mdAndUp && drawer"
v-model="drawer"
style="background-color: #374A67"
></v-navigation-drawer>
Works but in some situations just broke and if I resize the window the navigation drawer push the app bar when is hovered giving me an empty space. How can I do this the right way? Thank you
I'm trying to achieve to have my navigation drawer with expand-on-hover
property true if i'm on desktop and show the classic v-app-bar-nav-icon
if I'm on smaller screens or mobile.
I have done this but the behaviour is kinda weird:
<v-app-bar-nav-icon
v-if="!drawer"
@click="drawer = true"
></v-app-bar-nav-icon>
<v-navigation-drawer
app
dark
:expand-on-hover="$vuetify.breakpoint.mdAndUp && drawer"
v-model="drawer"
style="background-color: #374A67"
></v-navigation-drawer>
Works but in some situations just broke and if I resize the window the navigation drawer push the app bar when is hovered giving me an empty space. How can I do this the right way? Thank you
Share Improve this question edited Dec 14, 2021 at 14:33 isherwood 61.2k16 gold badges122 silver badges170 bronze badges asked May 1, 2020 at 16:18 Lorenzo FabroLorenzo Fabro 732 silver badges8 bronze badges 2- How did you hover on mobile? Right It is possible only using input device like a mouse or touchpad – Pallav Chanana Commented May 1, 2020 at 16:28
-
I'm not doing it, the
expand-on-hover
is deactivated in smaller screens. My question it's how to do it because it's not working properly the way I posted it. – Lorenzo Fabro Commented May 1, 2020 at 18:00
1 Answer
Reset to default 5This will work perfectly.
<v-navigation-drawer
:value="$vuetify.breakpoint.smAndDown? drawer : true"
app
dark
:expand-on-hover="$vuetify.breakpoint.mdAndUp"
style="background-color: #374A67"
></v-navigation-drawer>
本文标签:
版权声明:本文标题:javascript - How can I expand on hover navigation drawer and use app bar icon on smaller screens? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745426425a2658132.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论