Answer the question
In order to leave comments, you need to log in
How to access a variable from another file?
There is a config.js file for storing connection settings to Firebase:
export default {
data: () => ({
firebaseData: {
// тут объект с настройками
}
}),
methods: {
getDBData() {
return this.firebaseData
}
}
}
import config from './config'
import firebase from 'firebase/app'
firebase.initializeApp(config.methods.getDBData());
config.methods.getDBData()returns undefined in console.log(), how then to take data from data()?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question