f / vue-wait

Complex Loader and Progress Management for Vue/Vuex and Nuxt Applications
MIT License
2k stars 101 forks source link

Unknown custom element: <v-wait> - did you register the component correctly? For recursive components, make sure to provide the "name" option. #73

Closed afuno closed 5 years ago

afuno commented 5 years ago

Error:

Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

app.js:

document.addEventListener('DOMContentLoaded', (event) => {
  if (document.getElementById('app')) {
    new Vue({
      el: '#app',

      store,

      wait: new VueWait(),

      components: {
        // ...
      }
    })
  }
})

It does not help:

wait: new VueWait({
  accessorName: '$wait',

  useVuex: true,
  vuexModuleName: 'wait',

  registerComponent: true,
  componentName: 'v-wait',

  registerDirective: true,
  directiveName: 'v-wait',
})

component.vue:

<template>
  <v-wait for="loading items">
    <template slot="waiting">
      <div>
        Loading the list...
      </div>
    </template>

    <ul>
      <li v-for="(item, index) in items" :key="index">
        {{item}}
      </li>
    </ul>
  </v-wait>
</template>

Why does this error occur?