出现这个警告:
index.js?bed3:153 ./src/main.js
11:8-15 "export 'default' (imported as 'VueFire') was not found in 'vuefire'
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

当时还有这个错误:
Uncaught TypeError: Cannot read property 'install' of undefined
    at Function.Vue.use (vue.esm.js?efeb:5115)
    at eval (main.js?1c90:11)
    at Object../src/main.js (app.js:1540)
    at __webpack_require__ (app.js:679)
    at fn (app.js:89)
    at Object.0 (app.js:1573)
    at __webpack_require__ (app.js:679)
    at app.js:725
    at app.js:728

把代码段1改为代码段2即可:

代码段1

import Vuefire from 'vuefire'
Vue.use(Vuefire)

代码段2

import {firestorePlugin} from 'Vuefire'
Vue.use(firestorePlugin)

欲知详情,请点击此处

 
Logo

前往低代码交流专区

更多推荐