如何在 Nuxt.js 中创建自定义加载指示器?

use*_*495 3 javascript vue.js nuxt.js

在此页面(https://nuxtjs.org/api/configuration-loading-indicator#custom-indicators)内表示我可以创建自定义加载指示器,但没有说明如何创建。

有人可以帮助我 - 如何创建并将其设置到 nuxt.config 中?

aBi*_*uit 6

这是Nuxt.js 源代码中默认加载指示器的集合。

loadingIndicator基本上,您可以指定要用作in的 HTML 模板nuxt.config.js

export default {
  ..., // Other Nuxt configuration

  // Simple usage:
  loadingIndicator: '~/custom-locading-indicator.html',

  // Or with dynamic configuration variables passed via lodash template syntax
  loadingIndicator: {
    name: '~/custom-locading-indicator.html',
    color: '#000',
    background: '#fff'
  }
}
Run Code Online (Sandbox Code Playgroud)

请注意,指标可以访问