每个关于如何在 Vue 中使用 Firebase 的教程都说在 main.js 文件中我必须添加 Vue.use(VueFire); 这是有道理的。但是后来我收到了这条消息 export 'default' (imported as 'VueFire') was not found in 'vuefire'。
我尝试使用 import * as VueFire from 'vuefire' 并且它不再给出错误消息,但它似乎没有使用插件。
这是 main.js 文件
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import VueFire from 'vuefire'
Vue.config.productionTip = false
Vue.use(VueFire);
new Vue({
router,
render: h => h(App)
}).$mount('#app')