I followed the instructions from Vuetify Data Iterator Filter section
I am able to use various Vuetify components like v-btn
, v-card
, v-data-table
, v-data-iterator
, and more.
However, I encountered errors only with <v-list-item>
and <v-list-item-title>
.
I'm puzzled about the root cause of these issues.
Here are the error messages I received:
[Vue warn]: Unknown custom element:
<v-list-item>
- have you properly registered the component? For recursive components, ensure to provide the "name" option[Vue warn]: Unknown custom element:
<v-list-item-title>
- have you correctly registered the component? For recursive components, make sure to provide the "name" option.
Snippet of HTML code:
<template>
<div class="container">
<v-container fluid grid-list-md style="padding: 0">
<v-data-iterator
:items="items"
:items-per-page.sync="itemsPerPage"
:page="page"
:search="search"
:sort-by="sortBy.toLowerCase()"
:sort-desc="sortDesc"
hide-default-footer
>
<!-- More code here -->
</v-data-iterator>
</v-container>
</div>
</template>
JS excerpt:
export default {
data() {
return {
// Data properties
};
},
computed: {
// Computed properties
},
methods: {
// Methods
},
};
Output screenshot demonstrates successful implementation of other components.
Please refer to the https://i.sstatic.net/KzFzr.png
To rule out any installment issues, I revisited the Vuetify Quick Start guide and double-checked my Vuetify setup.
Below is the content in src\plugins\vuetify.js
file
import Vue from 'vue'
import Vuetify from 'vuetify/lib'
import 'vuetify/src/stylus/app.styl'
Vue.use(Vuetify, {
iconfont: 'md',
})
as well as in src\main.js
import Vue from "vue";
import firebase from './components/firebaseInit';
import App from "./App.vue";
import router from "./router";
import vuetify from './plugins/vuetify' // path to vuetify export
Vue.config.productionTip = false;
let app = '';
// Verify Firebase initialization before launching the Vue app
firebase.auth().onAuthStateChanged(() => {
if (!app) {
app = new Vue({
vuetify,
router,
render: h => h(App)
}).$mount("#app");
}
});
Despite attempting manual import of components, the same errors persisted:
import { VListItem, VListItemTitle } from "vuetify/lib";
export default {
components: {
'v-list-item': VListItem,
'v-list-item-title': VListItemTitle
},
...
}
I also performed the following troubleshooting steps:
- Delete
.node_modules
directory - Execute
npm update
- Run
npm install
Nevertheless, the issues remained unresolved. Extensive research yielded no solution to this predicament.