vue.js - 如何为我的 vuetify 应用程序制作响应式导航栏设计
问题描述
Vuetify V2.1.9 无法使用 vuetify 开发响应式导航栏设计。当我尝试使用以下代码进行编码时,我无法开发响应式导航栏设计。它不工作。如果你能修复代码,它会很有帮助。提前致谢 。有一个快乐的编码。我的要求就像一个正常的导航栏工作。当我在移动设备中打开页面时,它应该隐藏ment并显示汉堡菜单。
<v-navigation-drawer v-model="sideNav" absolute temporary>
<v-list-item-content class="hidden-sm-and-up">
<v-list dense>
<v-list-item v-for="item in guestNav" :key="item.name" link>
<v-list-item-icon>
<v-icon>mdi-user</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{ item.name }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
</v-list-item-content>
</v-navigation-drawer>
<v-toolbar color="#00A972" dark height="50px">
<v-spacer></v-spacer>
<v-toolbar-title>
<h5 style="font-weight: 500;">Projects</h5>
</v-toolbar-title>
<v-app-bar-nav-icon @click.native="sideNav = !sideNav" class="hidden-sm-and-up"></v-app-bar-nav-icon>
<div class="flex-grow-1"></div>
<v-spacer></v-spacer>
<v-toolbar-items class="hidden-sm-and-up">
<v-row justify="center">
<v-btn
text
:ripple="false"
color="white"
style="margin-top:7px;margin-right:20px;font-weight:400"
>HOME</v-btn>
<v-spacer></v-spacer>
</v-row>
</v-toolbar-items>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-row justify="center">
<v-btn
text
:ripple="false"
color="white"
style="margin-top:7px;margin-right:20px;font-weight:400"
>STORE</v-btn>
<v-spacer></v-spacer>
</v-row>
</v-toolbar-items>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-row justify="center">
<v-btn
text
:ripple="false"
color="white"
style="margin-top:7px;margin-right:20px;font-weight:400"
>WALLET</v-btn>
<v-spacer></v-spacer>
</v-row>
</v-toolbar-items>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-row justify="center">
<v-btn
text
:ripple="false"
color
style="margin-top:7px;margin-right:20px;font-weight:400"
>LOG IN</v-btn>
<v-btn
text
:ripple="false"
class="green"
dark
style="margin-top:7px;margin-right:20px;font-weight:400;background-color: #38B98A!important;"
>SIGN UP</v-btn>
<v-spacer></v-spacer>
</v-row>
</v-toolbar-items>
</v-toolbar>
解决方案
使用媒体查询使导航栏响应如下
@media only screen and (max-width: 768px) { .nav_item { display: none !important; } }
推荐阅读
- python - keras load_model TypeError:int()参数'NoneType'
- php - 使用 php 从两个 db 表中查询
- c - 在 C 中读取具有不一致输入的文件
- javascript - 将表单重定向到 Gatsby 中的唯一 URL?
- c++ - 如何将此函数重写为c ++中的指针?
- python - 需要 Selenium 和基本的 python 帮助
- sql - 数据库对象名称捕获以 oracle db 结尾的最后一个字符
- c# - Blazor Web Assembly 应用程序 - 从 blazor 组件调用 JavaScript 文档就绪后,输入字段绑定不起作用
- reactjs - 如何检查 jsx 标签中的 props 是否存在?
- c++ - C ++专门化单个成员函数