You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Vue CLI 5.x环境下能否使用Vuetify 3?安装后报错问题咨询

Can I Use Vuetify 3 with Vue CLI 5 (Vue 3)?

Short answer: Yes, Vuetify 3 is designed explicitly for Vue 3, so it should work seamlessly with Vue CLI 5. The errors you're seeing are almost certainly due to a misstep during setup, not an inherent incompatibility.

Let’s break down common issues and fixes to get your project running:

  • Double-check your Vuetify installation command
    If you ran vue add vuetify without specifying the version, it might have installed Vuetify 2 (which only supports Vue 2) by default. For Vue 3, you need to install the Vuetify 3 beta/stable build using:

    vue add vuetify@next
    
  • Verify your project’s Vue version
    Open your package.json and ensure the vue dependency is listed as ^3.x.x. Vue CLI 5 does support Vue 3, but it’s possible your project was initialized with Vue 2 accidentally. If so, you’ll need to either migrate the project to Vue 3 or switch to Vuetify 2.

  • Fix your Vuetify plugin configuration
    Vuetify 3 uses a different initialization pattern than Vuetify 2. Make sure your src/plugins/vuetify.js looks like this:

    import { createApp } from 'vue'
    import { createVuetify } from 'vuetify'
    import 'vuetify/styles' // Don't forget global styles
    
    const vuetify = createVuetify()
    
    createApp(App).use(vuetify).mount('#app')
    

    If your config still references Vue.use(Vuetify) or older syntax, that’s a sign you’re using Vuetify 2 instead of 3.

  • Resolve missing peer dependencies
    Vuetify 3 requires specific peer dependencies (like @mdi/font for icons, or vue-router if using routing). Run npm install again to ensure all dependencies are installed, or check your error logs for mentions of missing packages to install them manually.

  • Rule out conflicting plugins
    Some older Vue plugins might not be compatible with Vue 3 or Vuetify 3. Try temporarily disabling other plugins in your project to see if the error disappears, then update or replace any incompatible ones.

As a reference, the Vuetify documentation previously stated:

当前版本的Vuetify不支持Vue 3,对Vue 3的支持将随Vuetify v3版本的发布而提供。创建新项目时,请确保在Vue CLI的提示中选择了Vue 2,或安装到已有的Vue 2项目中。

This note applies to pre-Vuetify 3 versions. Now that Vuetify 3 is officially released, it’s fully compatible with Vue 3 and Vue CLI 5.

内容的提问来源于stack exchange,提问作者Darwin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 01:07:31