Skip to content

NuxtLoadingIndicator

在页面导航之间显示一个进度条。

使用方法

在你的 app.vuelayouts 中添加 NuxtLoadingIndicator

  • app.vue
html
<template>
  <NuxtLayout>
    <div>
      <NuxtLoadingIndicator />
      <!-- 在这里 -->
      <NuxtPage />
    </div>
  </NuxtLayout>
</template>

插槽

你可以通过 loading indicator 的默认插槽传递自定义的 HTML 或组件

属性

  • color: 进度条的颜色。可以设置为 false 来关闭显式的颜色样式。

  • height: 进度条的高度,以像素为单位(默认为 3)。

  • duration: 进度条的持续时间,以毫秒为单位(默认为 2000)。

  • throttle: 进度条出现和隐藏的节流时间,以毫秒为单位(默认为 200)。