“[Vue 警告]:未知的自定义元素:..."错误,当使用 vue

编程入门 行业动态 更新时间:2024-10-12 01:24:53
本文介绍了“[Vue 警告]:未知的自定义元素:..."错误,当使用 vue-cli-plugin-vuetify 的 vuetify UI 组件时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我的项目设置使用 vue-cli 和 vue-cli-plugin-vuetify.当我想使用任何 List Components 时,浏览器控制台会在大多数情况下抛出错误vuetify 元素,例如:

My project setup is using vue-cli with vue-cli-plugin-vuetify. When i want to use any of the List Components, the browser console throws errors on most of the vuetify elements, like:

[Vue 警告]:未知的自定义元素:<v-list-item-content>- 您是否正确注册了组件?对于递归组件,请确保提供名称"选项.

我的猜测是我需要对文件 /plugins/vuetify.js 做一些额外的配置才能使列表工作,但我不知道如何.

My guess is that i need to do some extra configuration on the file /plugins/vuetify.js to make the lists work but i don't know how.

我的文件 vuetify.js 看起来像这样:

My file vuetify.js looks like this:

import Vue from 'vue'
import Vuetify from 'vuetify/lib'

import 'vuetify/src/stylus/app.styl'

Vue.use(Vuetify, {
  iconfont: 'md',
})

main.js:

import Vue from 'vue'
import './plugins/vuetify'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

问题:如何让 vuetify 中的所有组件都能工作??

Questions: How can i make all components from vuetify work??

感谢您的帮助!

基本上,我所做的是使用 vue create projectX 创建一个新项目,然后使用 vue add vuetify 添加 vuetify.现在我希望能够使用 vuetify 文档中的示例.但是复制和粘贴示例会导致所描述的错误...

Basically, what i did was creating a new project with vue create projectX and then added vuetify with vue add vuetify. And now i want to be able to use the examples from the vuetify documentation. But copy&pasting the examples results in the described error...

推荐答案

尝试更新 vuetify:npm install -S vuetify@2.0.1

Try updating vuetify with: npm install -S vuetify@2.0.1

这篇关于“[Vue 警告]:未知的自定义元素:..."错误,当使用 vue-cli-plugin-vuetify 的 vuetify UI 组件时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-27 01:25:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1145690.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   元素   错误   Vue   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!