admin管理员组文章数量:1391757
When I use v-app-bar it comes with a fixed height (thickness). How do I adjust it? I'd like to make it thinner. My bar contains navigation buttons and a switch:
<template>
<v-app theme="dark">
<v-app-bar>
<v-btn to="one">One</v-btn>
<v-btn to="two">Two</v-btn>
<v-switch label="toggle"></v-switch>
</v-app-bar>
</v-app>
</template>
Vuetify Play
View source of the result shows this:
<div class="v-toolbar__content" style="height: 64px;">
<!----><!----><v-button>One</v-button><!----></div>
Update: I think I found a way, though now my bar content is neither aligned nor vertically centered. Is there a better option?
<template>
<v-app theme="dark">
<v-app-bar height="1px" class="my-height">
<v-btn to="one">One</v-btn>
<v-btn to="two">Two</v-btn>
<v-switch label="toggle"></v-switch>
</v-app-bar>
</v-app>
</template>
<style scoped>
.bar-areas {
grid-template-areas: none;
}
.my-height {
height: 48px;
}
</style>
Vuetify Play
When I use v-app-bar it comes with a fixed height (thickness). How do I adjust it? I'd like to make it thinner. My bar contains navigation buttons and a switch:
<template>
<v-app theme="dark">
<v-app-bar>
<v-btn to="one">One</v-btn>
<v-btn to="two">Two</v-btn>
<v-switch label="toggle"></v-switch>
</v-app-bar>
</v-app>
</template>
Vuetify Play
View source of the result shows this:
<div class="v-toolbar__content" style="height: 64px;">
<!----><!----><v-button>One</v-button><!----></div>
Update: I think I found a way, though now my bar content is neither aligned nor vertically centered. Is there a better option?
<template>
<v-app theme="dark">
<v-app-bar height="1px" class="my-height">
<v-btn to="one">One</v-btn>
<v-btn to="two">Two</v-btn>
<v-switch label="toggle"></v-switch>
</v-app-bar>
</v-app>
</template>
<style scoped>
.bar-areas {
grid-template-areas: none;
}
.my-height {
height: 48px;
}
</style>
Vuetify Play
Share Improve this question edited Mar 12 at 3:27 jrefior asked Mar 12 at 2:47 jrefiorjrefior 4,4312 gold badges21 silver badges33 bronze badges 6 | Show 1 more comment1 Answer
Reset to default 0@yuanyxh provided the answer in a comment: add a height attribute with the desired pixel height, no units. For example:
<template>
<v-app theme="dark">
<v-app-bar height="48">
<v-btn to="one">One</v-btn>
<v-btn to="two">Two</v-btn>
<v-switch label="toggle"></v-switch>
</v-app-bar>
</v-app>
</template>
Vuetify Play
The API shows a string type can alternatively be used, but I have not found any string value (besides a plain number) that isn't interpreted as zero. Using units, such as "48px", is also interpreted as zero.
本文标签: vuetifyjsHow to adjust thickness of Vuetify vappbarStack Overflow
版权声明:本文标题:vuetify.js - How to adjust thickness of Vuetify v-app-bar - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744771674a2624376.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
<v-app-bar height="48"></v-app-bar>
, please check the documentation. – yuanyxh Commented Mar 12 at 3:24