如何安装和开始使用 Vuetify 和 Vue.js 3

How to install and get started with Vuetify and Vue.js 3

我在哪里可以找到与 Vue.js 3 兼容的 新 Vuetify 版本 文档以及如何使用 Vue cli 安装和设置它:

在 vue 2 中我们这样做:

vue create project-name

然后 :

vue add vuetify

我们如何使用 Vue 3 做到这一点?

Before proceeding, it is important to note that this installation is intended primarily for testing purposes, and should not be considered for production applications.

您可以按照新文档 here 进行设置,如下所示:

创建新的 vue 项目:

vue create project-name

# change directory to the new created project

cd project-name

然后

vue add vuetify

这会将 main.js 文件更改为:

import { createApp } from 'vue'
import vuetify from './plugins/vuetify'
import App from './App.vue'

const app = createApp(App)
app.use(vuetify)

app.mount('#app')

./plugins/vuetify

import '@mdi/font/css/materialdesignicons.css'
import 'vuetify/lib/styles/main.sass'
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/lib/components'
import * as directives from 'vuetify/lib/directives'

export default createVuetify({
  components,
  directives,
})

你可以 fork 这个 repository 开始