import {firebaseFactory} from './common/firebase';
export default class Home extends PageManager {
loaded(next) {
console.log(firebaseFactory) //ƒ firebaseFactory(){_classCallCheck(this,firebaseFactory)}
firebaseFactory._test('test'); //__WEBPACK_IMPORTED_MODULE_3__common_firebase__.a._log is not a function
next
}
}
var firebase = require("firebase/app");
export class firebaseFactory {
init() {
var config = {...};
firebase.initializeApp(config);
}
_test(msg) {
console.log(msg)
}
}
home.js
上面的我正在尝试从./common/firebase
访问函数,以便像服务一样使用。如果你看看console.log上面说的是什么(注释掉了);你能看出我做错了什么吗?我很确定我必须使用app.js或webpack注册该模块,但我不知道如何