在./src/main.js 6:8-15中警告“在'vuefire'中找不到导出'默认'(导入为'vuefire')

时间:2019-10-07 13:51:41

标签: firebase vue.js

我不知道他为什么找不到路

main.js

import Vue from 'vue'
import App from './App.vue'
import 'firebase'
import vuefire from 'vuefire';
Vue.config.productionTip = false;
vue.use(vuefire)

new Vue({
    el: '#app',
    render: h => h(App)
})
  

./ src / main.js中的警告       6:8-15“在'vuefire'中找不到导出'默认'(导入为'vuefire')        @ ./src/main.js        @ multi(webpack)-dev-server / client?http://localhost:8080 webpack / hot / dev-server`       ./src/main.js

请帮助我

1 个答案:

答案 0 :(得分:0)

the documentation开始,我认为您希望vuefire的导入行是这样,因为vuefire软件包没有默认导出:

 # GAE yml setup
runtime: python27
api_version: 1
threadsafe: true

# URL handlers
handlers:
 - url: /
    static_files: dist/index.html
    upload: dist/index.html

  - url: /(.*)
    static_files: dist/\1
    upload: dist/(.*)

  - url: .*
    static_files: dist/index.html
    upload: dist/index.html

# GAE has a limit of 10,000 files so ignore node_modules and anything else thats not neccassary
skip_files:
  - node_modules/
  - .gitignore
  - src/
  - public/
  - babel.config.js
  - ^(.*/)?\..*$

(或者,如果您使用的是实时数据库而不是Firestore,则可能需要import { firestorePlugin } from 'vuefire'; 而不是rtdbPlugin

当您实际致电firestorePlugin时,它应该看起来像这样:

Vue.use