如何在ionic/vue 3中隐藏标题

ie3xauqp  于 2022-12-09  发布在  Ionic
关注(0)|答案(1)|浏览(135)

我想知道如何通过向下滚动页面来隐藏Vue3中的标题,并在向上滚动时重新显示它。
我尝试了所有我能在网上找到的东西,但对我不起作用。

nbysray5

nbysray51#

您可以在ion-content上使用事件:
例如:

<template>
  <ion-content
    :scroll-events="true"
    @ionScrollStart="logScrollStart()"
    @ionScroll="logScrolling($event)"
    @ionScrollEnd="logScrollEnd()">
      <h1>Main Content</h1>

      <div slot="fixed">
        <h1>Fixed Content</h1>
      </div>
  </ion-content>
</template>

<script>
import { IonContent } from '@ionic/vue';
import { defineComponent } from 'vue';

export default defineComponent({
  components: { IonContent }
});
</script>

文件

相关问题