所以我创建了一个vue应用程序,并从Vue模块导入了vue,但是我得到了这个错误。
ERROR in src/main.ts:4:5
TS2339: Property 'use' does not exist on type 'typeof import("/data/data/com.termux/files/home/ishankbg.tech/node_modules/vue/dist/vue")'.
2 | import App from './App.vue'
3 | import { firestorePlugin } from 'vuefire';
> 4 | Vue.use(firestorePlugin);
| ^^^
5 | createApp(App).mount('#app');
6 |我在我的vue应用程序中使用打字本。我使用@vue/cli生成了这个项目。我想使用vuefire的firestorePlugin。
我正在使用Vue3这里是源代码
import Vue, { createApp } from 'vue'
import App from './App.vue'
import { firestorePlugin } from 'vuefire';
Vue.use(firestorePlugin);
createApp(App).mount('#app');我不知道是什么导致了这个错误
发布于 2021-03-02 12:08:03
在Vue 3中还不支持火种。从主页:
注意:这个版本目前支持Vue 2和Firebase 7。对Vue 3/ Composition和Firebase 8的支持即将到来。
Vue.use是安装插件的Vue 2方式。一旦Vuefire支持Vue 3,请使用app.use而不是Vue.use。在Vue 3中,Vue不是来自"vue"包的有效导出:
import { createApp } from 'vue'
import App from './App.vue'
import { firestorePlugin } from 'vuefire';
const app = createApp(App);
app.use(firestorePlugin);
app.mount("#app");https://stackoverflow.com/questions/66438873
复制相似问题