我是第一次使用 TypeScript 构建我的 vue 应用程序,我一直被这个Property 'xxx' does not exist on type 'typeof问题所困扰。我研究过类似的问题,但似乎没有一个工作。我在"vue": "^3.0.0-0"和"typescript": "~3.9.3"
我安装了 vuetify,所以在我的 vuetify.ts 我有第一个错误(属性 'use' 在类型 'typeof 上不存在)
import Vue from 'vue'
import Vuetify from 'vuetify'
Vue.use(Vuetify)
export default new Vuetify({
})
Run Code Online (Sandbox Code Playgroud)
我在我的 main.ts 中传递它
createApp(App)
.use(store)
.use(router)
.use(vuetify)
.mount('#app')
Run Code Online (Sandbox Code Playgroud)
然后在我的 App.vue 上,另一个错误在哪里(类型“typeof”上不存在属性“extend”)我有
export default Vue.extend({
name: 'App',
components: {
//
},
data: () => ({
//
})
})
Run Code Online (Sandbox Code Playgroud)
我也遵循了这里推荐的配置