【问题标题】:Vuetify appbar double scrollbarVuetify appbar 双滚动条
【发布时间】:2022-01-29 17:04:53
【问题描述】:

我目前正在尝试使用 vuetify 开发一个应用程序。但是我无法让滚动阈值应用栏正常工作。如果我正确放置了内容,则滚动收缩将无法正常工作,反之亦然。我设法让内容和滚动条相互定位,但现在页脚下有大量空白,并且应用程序使用的是 vuetify 滚动条而不是浏览器滚动条。

这是我的 App.vue

<template>
  <v-app>

  <v-app-bar 
      app
      style="position:fixed"
      absolute
      color="#43a047"
      dark
      shrink-on-scroll
      prominent
      src="https://picsum.photos/1920/1080?random"
      fade-img-on-scroll
      scroll-target="#scrolling-techniques-5"
      scroll-threshold="500"
    >
    <template v-slot:img="{ props }">
        <v-img
          v-bind="props"
          gradient="to top right, rgba(55,236,186,.7), rgba(25,32,72,.7)"
        ></v-img>
      </template>
    <!-- -->
  </v-app-bar>
  <v-sheet
      id="scrolling-techniques-5"
      class="overflow-y-auto"
      max-height="600"
    >
      <v-container  fluid style="height: 1500px;">
        <v-main>
      <router-view></router-view>
    
      </v-main>
    </v-container>
    
  </v-sheet>
    
  <!-- Sizes your content based upon application components -->
  <v-footer
    color="primary lighten-1"
    padless
  >
    <v-row
      justify="center"
      no-gutters
    >
      <v-btn
        v-for="link in links"
        :key="link"
        color="white"
        text
        rounded
        class="my-2"
      >
        {{ link }}
      </v-btn>
      <v-col
        class="primary lighten-2 py-4 text-center white--text"
        cols="12"
      >
        {{ new Date().getFullYear() }} — <strong>Vuetify</strong>
      </v-col>
    </v-row>
  </v-footer>

  
</v-app>
</template>

<script>
  export default {
    data: () => ({
      links: [
        'Home',
        'About Us',
        'Team',
        'Services',
        'Blog',
        'Contact Us',
      ],
    }),
  }
</script>

任何帮助将不胜感激!

【问题讨论】:

    标签: javascript html vue.js vuetify.js


    【解决方案1】:

    去掉v-container上的高度height: 1500px

     <v-sheet
          id="scrolling-techniques-5"
          class="overflow-y-auto"
          max-height="600"
        >
          <v-container fluid>
            <v-main>
          <router-view></router-view>
        
          </v-main>
        </v-container>
        
      </v-sheet>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-10
      • 1970-01-01
      • 2017-02-08
      • 2019-11-30
      • 1970-01-01
      • 2019-11-20
      • 2021-06-30
      相关资源
      最近更新 更多