ome*_*ega 2 javascript vue.js vuejs2 vuetify.js
在 vuetify 我使用工具栏
<v-toolbar dark color="primary">
<v-toolbar-side-icon @click.stop="drawer.drawer = !drawer.drawer"></v-toolbar-side-icon>
<v-toolbar-title>{{drawer.title}}</v-toolbar-title>
</v-toolbar>
<router-view v-bind:page="pageData"></router-view>
Run Code Online (Sandbox Code Playgroud)
但我想修复它,而不是与 vuerouter 内容重叠。我怎样才能做到这一点?我试过放置,fixed但它仍然重叠。
谢谢
小智 5
在标签中使用 css 参数style。参见)https://journal.simondepelchin.be/2019/03/04/how-to-make-a-sticky-tabs-bar-with-vuetify/
<template>
<v-toolbar class="fixed-bar">
<!-- ... -->
</v-toolbar>
</template>
<style scoped>
.fixed-bar {
position: sticky;
position: -webkit-sticky; /* for Safari */
top: 6em;
z-index: 2;
}
</style>
Run Code Online (Sandbox Code Playgroud)