vuetify 中的 v-app-bar 和 v-toolbar 有什么区别? [英] What is difference between v-app-bar and v-toolbar in vuetify?
问题描述
我刚刚开始探索 vuetify.所有 vuetify 组件都位于
.
我想为我的网站创建菜单,所以在文档中我找到了 <v-app-bar>
和 <v-toolbar>
我很困惑,如果我应该将菜单项保留在 <v-app-bar>
或 <v-toolbar>
中,如官方文档所述
I just started exploring vuetify. All the vuetify componets resides in <v-app>
.
I wanted to create menu for my site so in documentation I found <v-app-bar>
and <v-toolbar>
I am confused that if I should keep menu items inside <v-app-bar>
or <v-toolbar>
as offical documentation says
关于
https://vuetifyjs.com/en/components/app-bars
v-app-bar
组件对于任何图形用户界面都至关重要(GUI),因为它通常是站点导航的主要来源.这app-bar 组件与v-navigation-drawer 用于在您的应用程序中提供站点导航.
The
v-app-bar
component is pivotal to any graphical user interface (GUI), as it generally is the primary source of site navigation. The app-bar component works great in conjunction with a v-navigation-drawer for providing site navigation in your application.
关于
https://vuetifyjs.com/en/组件/工具栏
v-toolbar
组件对于任何 gui 都至关重要,因为它通常是网站导航的主要来源.工具栏组件很好用结合 v-navigation-drawer 和 v-card.
The
v-toolbar
component is pivotal to any gui, as it generally is the primary source of site navigation. The toolbar component works great in conjunction with v-navigation-drawer and v-card.
两者的描述几乎相同.两者有什么区别以及我们何时应该使用什么?或者我们应该在 v-app-bar
中使用 v-toolbar
?
Both the description are almost same. What is difference in both and when we should use what? or we should use v-toolbar
inside v-app-bar
?
推荐答案
根据 Vuetify 迁移指南——'从 v1.5.x 迁移到 v2.0.x':
v-toolbar:所有现有的滚动技术和应用程序功能已弃用并移至 v-app-bar.
v-toolbar: All existing scrolling techniques and app functionality has been deprecated and moved to v-app-bar.
因此,从 Vuetify 2.0 开始,v-app-bar
是您可能希望在大多数典型应用程序顶部使用的,因为您可以执行与滚动相关的效果并指定 v-app-bar
作为唯一的顶级"应用程序组件使用 app
道具.
Thus, starting in Vuetify 2.0, v-app-bar
is what you probably want to use at the top of most typical apps since you can do scrolling-related effects and designate v-app-bar
as a unique 'top level' application component using the app
prop.
另一方面,v-toolbar
可用于其他从属"情况,其中滚动绝对不应该影响工具栏,也许如果 v-toolbar
正在用作屏幕内小部件的一部分.
On the other hand, v-toolbar
could be used for other 'subordinate' cases where scrolling should definitely not affect the toolbar, perhaps if v-toolbar
is being used as part of a in-screen widget.
这篇关于vuetify 中的 v-app-bar 和 v-toolbar 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!